TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

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

Резултати

Пронајдени 26 слични објави

Пребарај: #baklava

当前筛选 #baklava清除筛选
Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #713 · 13.02.2026 г., 04:29

Lineage OS - Official | Android 16 | Nothing Phone (2) ✍️ Details: - Version: 23.2 - Codename: #Pong - Initial Build: 10/02/26 - Build Freq: Weeklies (Search for #Pong) 🔽 Download: ROM & Images | GAPPS (sideload) | Unofficial MicroG Builds ⚙️ Wiki: Here 📔 Changelogs: Here 🤝 CF Participants: Here | Ref 🔖 Tags: #ROM#LOS#Official#Baklava#Vanilla ❌ Known quirks: - Device Integrity ~ As always thanks Goolag! 👤 Dev: chandu078 🐙 Chat: @NothingPhone2 🔔 Updates: @NothingPhone2Updates

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #740 · 06.05.2026 г., 07:29

Paranoid Android - Unofficial | Android 16 | Nothing Phone (2) 📔Details: • Version: Beryl (Alpha) • Device: #Pong • Updated: 13/05/26 🔽 Download: Here | Sideload 🆘 Bug Reports: Here 🔖Tags: #AOSPA#Unofficial#Baklava#CLO#NothingPhone2#Beryl ✨ Changelogs - Fixed upstream tethering apex failing to boot - Improvements to performance and system stability ⚙️Installation: 1. fastboot flashing unlock_critical (skip if already unlocked) 2. Execute this for flashing the ROM: fastboot -w fastboot update path/to/aospa zip 3. Wait for boot to finish ✍️ Note: - Firmware is included. No need to flash seperately. - Clean flash is recommended 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #736 · 02.05.2026 г., 05:06

Paranoid Android - Unofficial | Android 16 | Nothing Phone (2) 📔Details: • Version: Beryl (Alpha) • Device: #Pong • Updated: 04/05/26 🔽 Download: Here 🆘 Bug Reports: Here ✨ Changelogs: Here 🔖Tags: #AOSPA#Unofficial#Baklava#CLO#NothingPhone2#Beryl ⚙️Installation: 1. fastboot flashing unlock_critical (skip if already unlocked) 2. Execute this for flashing the ROM: fastboot -w fastboot update path/to/aospa zip 3. Wait for boot to finish ✍️ Note: - Firmware is included. No need to flash seperately. - Clean flash is recommended 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Nothing Phone (2) | Updates

@NothingPhone2Updates · Post #700 · 19.12.2025 г., 14:30

Paranoid Android - Unofficial | Android 16 | Nothing Phone (2) 📔Details: • Version: Beryl (Alpha) • Device: #Pong • Updated: 19/12/25 🔽 Download: Here 🆘 Bug Reports: Here 🔖Tags: #AOSPA#Unofficial#Baklava#CLO#NothingPhone2#Beryl ✨Changelogs: - Based on current QSSI16 and V4.0-251119-1654 - Improvements to performance and system stability - While feedback is appreciated, please do not explicitly mention me, I can read chat on my own thanks ⚙️Installation: 1. fastboot flashing unlock_critical (skip if already unlocked) 2. Execute this for flashing the ROM: fastboot -w fastboot update path/to/aospa zip 3. Wait for boot to finish ❗️Known bugs: - UW camera does not show up in aperture - Left volume panel isn't aligned in landscape ✍️ Note: - Firmware is included. No need to flash seperately. - Clean flash is recommended 👤 Dev: @gotenksIN 🔔Updates : @NothingPhone2Updates 💬Chat : @NothingPhone2

Oneplus 13 Updates

@OnePlus13Series · Post #383 · 07.04.2026 г., 14:25

DerpFest - Official | Android 16 | Oneplus 13 ✍️ Details: - Version: 16 - Codename: #dodge - Variant: #Gapps - Released: 07/04/26 🔽 Download : Sourgeforge | Mirror 🔖 Tags: #Derpfest#Official#Baklava#ROM#dodge ⚙️Flashing Instructions: - Using SuperHybrid Flasher (recommended) - It also can be flashed through Ofox recovery. ✍️Notes: - GApps Included, do not flash again - April Security Patch (QPR2) - Lineage Upstream - Upstreamed kernel - FW 16.0.5.701 ARB !!! - Don't report without proper logs! 🏆Credits: - Chandu_078 - bgcngm - jonassalo93 - danielspringer - jakobBokaj1 - Testers 👤 Maintaner: @einargednochsson 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Oneplus 13 Updates

@OnePlus13Series · Post #379 · 08.03.2026 г., 18:36

DerpFest - Official | Android 16 | Oneplus 13 ✍️ Details: - Version: 16 - Codename: #dodge - Variant: #Gapps - Released: 08/03/26 🔽 Download : Sourgeforge | Mirror 🔖 Tags: #Derpfest#Official#Baklava#ROM#dodge ⚙️Flashing Instructions: - Using SuperHybrid Flasher (recommended) - It also can be flashed through Ofox recovery. ✍️Notes: - GApps Included, do not flash again - March Security Patch (QPR2) - Lineage Upstream - Reworked kernel - FW 16.0.3.501 ARB !!! - Don't report without proper logs! 🏆Credits: - Chandu_078 - bgcngm - @jonassalo93 - @danielspringer - @jakobBokaj1 - Testers 👤 Maintaner: @einargednochsson 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Oneplus 13 Updates

@OnePlus13Series · Post #376 · 13.02.2026 г., 20:34

DerpFest - Official | Android 16 | Oneplus 13 ✍️ Details: - Version: 16 - Codename: #dodge - Variant: #Gapps - Released: 13/02/26 🔽 Download : Sourgeforge | Mirror 🔖 Tags: #Derpfest#Official#Baklava#ROM#dodge ⚙️Flashing Instructions: - Using SuperHybrid Flasher (recommended) - It also can be flashed through Ofox recovery. ✍️Notes: - GApps Included, do not flash again - February Security Patch (QPR2) - FW 16.0.3.501 ARB !!! - Don't report without proper logs! 🏆Credits: - Chandu_078 - bgcngm - @jonassalo93 - @danielspringer - @jakobBokaj1 - Testers 👤 Maintaner: @einargednochsson 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Oneplus 13 Updates

@OnePlus13Series · Post #362 · 13.12.2025 г., 18:07

DerpFest - Official | Android 16 | Oneplus 13 ✍️ Details: - Version: 16 - Codename: #dodge - Variant: #Gapps - Released: 13/12/25 🔽 Download : Sourgeforge | Mirror 🔖 Tags: #Derpfest#Official#Baklava#ROM#dodge ⚙️Flashing Instructions: - Using SuperHybrid Flasher (recommended) - Without SuperHybrid Flasher - It also can be flashed through Ofox recovery. ✍️Notes: - GApps Included, do not flash again - December Security Patch - Updated kernel - Don't report without proper logs! 🏆Credits: - Chandu_078 - bgcngm - @jonassalo93 - @danielspringer - @jakobBokaj1 - Testers 👤 Maintaner: @einargednochsson 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Oneplus 13 Updates

@OnePlus13Series · Post #357 · 29.11.2025 г., 08:02

DerpFest - Official | Android 16 | Oneplus 13 ✍️ Details: - Version: 16 - Codename: #dodge - Variant: #Gapps - Released: 26/11/25 🔽 Download : Sourgeforge | Mirror 🔖 Tags: #Derpfest#Official#Baklava#ROM#dodge ⚙️Flashing Instructions: - Using SuperHybrid Flasher (recommended) - Without SuperHybrid Flasher - It also can be flashed through Ofox recovery. ✍️Notes: - GApps Included, do not flash again - November Security Patch - A16 blobs/kernel - Don't report without proper logs! 🏆Credits: - Chandu_078 - bgcngm - @jonassalo93 - @danielspringer - @jakobBokaj1 - Testers 👤 Maintaner: @einargednochsson 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Oneplus 13 Updates

@OnePlus13Series · Post #353 · 13.11.2025 г., 15:53

DerpFest - Official | Android 16 | Oneplus 13 ✍️ Details: - Version: 16 - Codename: #dodge - Variant: #Gapps - Released: 12/11/25 🔽 Download : Sourgeforge | Mirror 🔖 Tags: #Derpfest#Official#Baklava#ROM#dodge ⚙️Flashing Instructions: - Using SuperHybrid Flasher (recommended) - Without SuperHybrid Flasher - It also can be flashed through Ofox recovery. ✍️Notes: - GApps Included, do not flash again - November Security Patch - Don't report without proper logs! 🏆Credits: - Chandu_078 - bgcngm - @jonassalo93 - @danielspringer - @jakobBokaj1 - Testers 👤 Maintaner: @einargednochsson 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Oneplus 13 Updates

@OnePlus13Series · Post #387 · 14.05.2026 г., 07:57

Pixel OS - Unofficial | Android 16 | Oneplus 13 ✍️ Details: - Version: 16.2 - Codename: #dodge - Variant: #Gapps - Released: 26/05/14 🔽 Download 🔖 Tags: #PixelOS#Unofficial#ROM#dodge#Baklava ✍️ Notes: ❗❗❗ARB❗❗❗ - Try to fix ltpo - Bring high touch polling rate - Bring back BThelper - Sync Pixel OS upstream updates. 🏆 Credits: - Chandu_078 & bgcngm for base DT - einargednochsson & Daniel & jjpprrrr & Jonas Salo - And everyone who contributed to the OnePlus 13 open-source ROM. 👤 Maintainer: @likw233 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

Oneplus 13 Updates

@OnePlus13Series · Post #385 · 13.04.2026 г., 05:12

Pixel OS - Unofficial | Android 16 | Oneplus 13 ✍️ Details: - Version: 16.2 - Codename: #dodge - Variant: #Gapps - Released: 26/04/13 🔽Download 🔖 Tags: #PixelOS#Unofficial#ROM#dodge#Baklava ✍️ Notes: ❗❗❗ARB❗❗❗ - Add freedom from crd - Sync Pixel OS upstream updates. 🏆 Credits: - Chandu_078 & bgcngm for base DT - einargednochsson & Daniel & jjpprrrr & Jonas Salo - And everyone who contributed to the OnePlus 13 open-source ROM. 👤 Maintainer: @likw233 🔔 Updates: @OnePlus13Series 💬 Discussion: @OnePlus13SeriesChatRoom

ПретходнаСтраница 1 од 3Следна