Тёмный

FastAPI - Request Body and POST requests | Pydantic pre-validators 

BugBytes
Подписаться 31 тыс.
Просмотров 7 тыс.
50% 1

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@LucidProgramming
@LucidProgramming 5 месяцев назад
You are an excellent teacher and have an equally great taste in music. Love the Aphex Twin and Boards of Canada references. Cheers!
@bugbytes3923
@bugbytes3923 5 месяцев назад
Thanks a lot! Appreciate it! I love Aphex/BoC and similar artists - and that music is what I go for when coding too, often!
@victorajayi9056
@victorajayi9056 8 месяцев назад
isn't validator deprecated in Pydantic v2?
@Ama-u6p
@Ama-u6p 3 месяца назад
Yes, use the new field_validator function: class BandCreate(BandBase): @field_validator("genre", mode='before') def title_case_genre(cls, value): return value.title()
@AkivaShor-l9c
@AkivaShor-l9c 14 дней назад
It is - you have to change the code to: from pydantic import BaseModel, field_validator @field_validator('genre', mode='before') @classmethod
@AmoahDevLabs
@AmoahDevLabs 9 месяцев назад
Great as always. Thanks very much for your time.
@bugbytes3923
@bugbytes3923 9 месяцев назад
Thank you as always!
@seydinaoumarsamabaly1806
@seydinaoumarsamabaly1806 9 месяцев назад
Thank you man for giving us our dose of week-end ! All clear.
@bugbytes3923
@bugbytes3923 9 месяцев назад
Thanks as always man!!
@深夜酒吧
@深夜酒吧 9 месяцев назад
did you edit your video after recording? or just one shot and upload?
@photiosloupis4529
@photiosloupis4529 9 месяцев назад
Very clear and concise at a pace that that is welcomed. Looking forward to when you get to PostgreSQL integration with particular interest in working with Enums with PostgreSQL as well as relationships and link tables. Thank you for taking the time to make this series, I am really enjoying your content.
@bugbytes3923
@bugbytes3923 9 месяцев назад
Thanks a lot for the nice comment, cheers!
@frameff9073
@frameff9073 9 месяцев назад
good
@bugbytes3923
@bugbytes3923 9 месяцев назад
Thanks!
@farzadmf
@farzadmf 9 месяцев назад
Is it safe to call model_dump directly on what we receive from the request with no validation?
@bugbytes3923
@bugbytes3923 9 месяцев назад
You can apply validation for each field in the Pydantic model that defines the data expected from the body. That data will be converted to an instance of the Model used as a parameter, and will either pass/fail validations defined in the model (constraints, type-conversions, custom validator functions, etc). You could perform further validation in the handler function too, if you'd like (check for HTML, SQL, etc). Any input sent to the database should be sanitized of course... will look at that later in the series!
@farzadmf
@farzadmf 9 месяцев назад
I mostly went security wise; normally, it's a terrible idea to just trust what you receive and do something with it
@hamzaelmhoujab2350
@hamzaelmhoujab2350 3 месяца назад
Great video 🦾
@bugbytes3923
@bugbytes3923 3 месяца назад
Thanks a lot!
@stevenwilson2292
@stevenwilson2292 8 месяцев назад
Will there be more in this series?
@bugbytes3923
@bugbytes3923 8 месяцев назад
Yes, definitely! Need to prepare some more, and I've started with a full-stack app too that uses FastAPI.
@abhishekdhiman5719
@abhishekdhiman5719 8 месяцев назад
@@bugbytes3923 can you create a video on database integration, as you said in the video
Далее
FastAPI and Pydantic - Model Classes and Nested Models
14:45
БЕЛКА ЗВОНИТ ДРУГУ#cat
00:20
Просмотров 788 тыс.
Bearwolf - GODZILLA Пародия Beatrise
00:33
Просмотров 333 тыс.
DuckDB and SQL - for Data Analysis and Processing
24:31
Why You NEED To Learn FastAPI | Hands On Project
21:15
Просмотров 163 тыс.
Fast API Tutorial, Part 4: Request Body
15:13
Просмотров 27 тыс.
Intro to async Python | Writing a Web Crawler
14:23
Просмотров 79 тыс.