@DESI_MEMES_Funny_Jokes · Post #5658 · 01.11.2024 г., 08:09
Bach Gaya 🤣🤣🤣 #reels#funnyreels
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #397 · 12 ное.
Использование Pydantic сегодня стало нормой, и это правильно. Но иногда на ревью вижу, что используют его не всегда корректно. Например, метод BaseModel.model_dump() по умолчанию не преобразует стандартные типы, такие как datetime, UUID или Decimal, в простой сериализуемый для JSON вид. Тогда пишут кастмоный сериализатор для этих типов чтобы функция json.dump() не падала с ошибкой. import uuid from datetime import datetime from decimal import Decimal from uuid import UUID from pydantic import BaseModel class MyModel(BaseModel): id: UUID date: datetime value: Decimal obj = MyModel( id=uuid.uuid4(), date=datetime.now(), value='1.23' ) print(obj.model_dump()) # не подходит для json.dump # { # 'id': UUID('4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1'), # 'date': datetime.datetime(2025, 12, 12, 12, 12, 12, 111111), # 'value': Decimal('1.23') # } # добавляем свой кастомный сериализатор json.dumps(obj.model_dump(), cls=MySerializer) # { # 'id': '4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1', # 'date': '2025-12-12T12:12:12.111111', # 'value': '1.23' # } В данном случае класс MySerializer обрабатывает datetime, UUID и Decimal. Например так: class MySerializer(json.JSONEncoder): def default(self, o): if isinstance(o, Decimal): return str(o) elif isinstance(o, datetime): return o.isoformat() elif isinstance(o, UUID): return str(o) return super().default(o) Специально для тех, кто всё еще так делает - в этом нет необходимости! Pydantic может это сделать сам, просто нужно добавить параметр mode="json". json.dumps(obj.model_dump(mode="json")) # { # 'id': '4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1', # 'date': '2012-12-12T12:12:12.111111', # 'value': '1.23' # } #pydantic#libs
Пребарај: #funnyreels
@DESI_MEMES_Funny_Jokes · Post #5658 · 01.11.2024 г., 08:09
Bach Gaya 🤣🤣🤣 #reels#funnyreels
Hashtags
@desi_memes_funny_jokes · Post #4694 · 02.06.2024 г., 15:35
#funnyreels#funnymemes
Hashtags
@desi_memes_funny_jokes · Post #4615 · 25.05.2024 г., 04:55
Comment 😂 | #trendingreels#viralreels#funnyreels
@desi_memes_funny_jokes · Post #4729 · 05.06.2024 г., 17:29
Uncle ko ghusaa bhari pad gya 😂 #funny#comedy#funnyreels
Hashtags
@DESI_MEMES_Funny_Jokes · Post #5867 · 26.11.2024 г., 07:32
How to be Successful #comedyreels#funnyvideos#funnyreels
@instablog9jaofficial · Post #173896 · 18.05.2026 г., 18:07
So village people are actually holding monthly board meetings and Nigerians are STILL stressing them 😭💀 Wait till you hear why Emeka really failed JAMB 😂 Comment the funniest excuse you’ve heard before 👀 #NigerianComedy #VillagePeople #FunnyReels #Instablog9jaVibes
@instablog9jaofficial · Post #173848 · 17.05.2026 г., 19:26
Nigerians even carried their wahala enter heaven immigration office 😭☁️ #Instablog9jaVibes#NigerianComedy#AITiktok#FunnyReels
@desi_memes_funny_jokes · Post #4752 · 08.06.2024 г., 09:08
Wait for end 😂😂 . . . #reels#funny#reelsinstagram#explore#funnyreels
@desi_memes_funny_jokes · Post #4674 · 31.05.2024 г., 14:23
Weight Guys 👏😂😂 #reels#funnyreels#friendsforlife#comedyreels
@capcut_editing_material · Post #1310 · 04.07.2025 г., 05:32
🐵 MONKEY AI + 500+ REEL BUNDLE is HERE! 🎬 🔥 Download the funniest + most viral-ready Monkey AI Videos with a massive collection of 500+ Reels! 📦 What You Get: ✅ Monkey AI Viral Videos 🐒 ✅ 500+ Engaging Reels ✅ Perfect for Instagram, YouTube Shorts & Telegram ✅ Instant Download – Ready to Post! 👇 Grab it Now 👇 🔗https://adrinolinks.com/ZRCk 💥 Use them for meme pages, reel edits, or just pure entertainment — these will go viral! #MonkeyAI#ReelBundle#FunnyReels#AIVideos#MonkeyVideos
@DESI_MEMES_Funny_Jokes · Post #5986 · 08.12.2024 г., 16:56
Tag that biker friend 😂... #funnyreels#funnyvideos#trending#idea#unlock
@desi_memes_funny_jokes · Post #5342 · 30.09.2024 г., 06:05
Dahej me sali de rahe hai #memes#funnyreels#comedyreels#viral#comedyreels#funnyreels#comedymemes#sarcasm#hindimemes