Тёмный

Validate your request data using Marshmallow and Flask 

Demos Petsas
Подписаться 801
Просмотров 1,3 тыс.
50% 1

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

 

14 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@sandip_kanzariya8476
@sandip_kanzariya8476 6 месяцев назад
very nice Explanation
@PetsasSoftware
@PetsasSoftware 6 месяцев назад
Thank you for the support!
@mm333-e1t
@mm333-e1t Год назад
Thanks a lot for such a wonderful series. You really have structured the lessons very well.!! ❤
@PetsasSoftware
@PetsasSoftware Год назад
I am glad you found it useful, thanks for watching!
@aes0p895
@aes0p895 Год назад
very helpful, thanks. marshmallow seems pretty easy to understand.
@PetsasSoftware
@PetsasSoftware Год назад
Glad you liked the video! Yes it’s a nice intuitive library for validating and serialising your data!
@andreasspyrou5902
@andreasspyrou5902 Год назад
Πολυ ωραιο βιντεο !! Ισως δουμε και ενα tutorial για την django,..
@PetsasSoftware
@PetsasSoftware Год назад
Σύντομα έρχονται βίντεο και για django!
@mm333-e1t
@mm333-e1t Год назад
How would this work if I want to fetch data from multiple models and send in a single response object. Kind of like having a data formed by SQL join statements, which joins multiple tables and creates a response data, how would such a data by serialized.
@PetsasSoftware
@PetsasSoftware Год назад
Hi there very good question and very common use case. In marshmallow you can have nested schemas within schemas like you have fields for example if you have a user that has many addresses as well as a single profile you would do the following: from marshmallow import Schema, fields class AddressSchema(Schema): city = fields.String() street = fields.String() postcode = fields.String() class ProfileSchema(Schema): dob = fields.DateTime() language = fields.String() class UserSchema(Schema): name = fields.String() email = fields.Email() created_at = fields.DateTime() addresses = fields.Nested(AddressSchema, many=True) profile = fields.Nested(ProfileSchema) Make sure to eager load the related models on the user in the view to not get n+1 queries! Hope this helps, if you have any questions let me know!
@dharmik_92
@dharmik_92 10 месяцев назад
This nested things work like sort of inheritence right? from extensions import ma from models.users import User class UserSchema(ma.SQLAlchemyAutoSchema): class Meta: model = User exclude = ["id", "is_deleted", "is_active", "created_at", "modify_at"] class UserInfo(UserSchema): class Meta: exclude = ["hashed_password"] so when i get info of user i don't leak password. UserSchema will be use for creating user and Userinfo to get limited info of users
Далее
Authenticating a Flask API - Flask JWT Crash Course
51:21
Part 5. Roblox trend☠️
00:13
Просмотров 2,7 млн
А я с первого раза прошла (2024)
01:00
SQLAlchemy ORM crash course - Learn SQLAlchemy in 1 hour
1:00:35
Flask & Flask-SQLAlchemy Model Relationships
21:34
Просмотров 26 тыс.
Metaclasses in 17 minutes
17:29
Просмотров 4,9 тыс.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Просмотров 202 тыс.