@testflightynoti · Post #37667 · 07.05.2026 г., 06:24
#Temple#AI Join the Temple AI beta on ✈️#TestFlight 🔗 Link: https://testflight.apple.com/join/qZDDMhyK Shared by Dimitri
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
Пребарај: #temple
@testflightynoti · Post #37667 · 07.05.2026 г., 06:24
#Temple#AI Join the Temple AI beta on ✈️#TestFlight 🔗 Link: https://testflight.apple.com/join/qZDDMhyK Shared by Dimitri
Hashtags
@AloneSnowflake · Post #500 · 09.05.2025 г., 21:32
⊹ 𝐀pply 𝐓heme ˓ 🛕 ˒ ༄ 𝐉oin 𝐂hannel ˙˚• #Temple#Light#Gray#Red#Theme
@Wallpaper_INT · Post #47570 · 01.01.2026 г., 05:31
#PaperArt#Mountains#Temple#4K @Wallpaper_INT
Hashtags
@voir_yeux · Post #12632 · 23.04.2026 г., 15:33
🇹🇭 Le temple Wat Phra Dhammakaya en Thaïlande a accueilli une méditation collective à l’occasion de la Journée de la Terre. #thaïlande#méditation#temple
Hashtags
@TestFlightX · Post #34533 · 08.11.2024 г., 04:20
#TEMPLE#RUN#ADVENTURE https://testflight.apple.com/join/8c2K8z2s
Hashtags
@voir_yeux · Post #12350 · 31.03.2026 г., 13:23
🇮🇳 Au moins huit personnes sont mortes lors d'une bousculade dans l'enceinte du temple dans le district de Nalanda de l'État du Bihar, dans le nord-est de l'Inde, rapporte la police. #inde#temple#bousculade#victimes
Hashtags
@arch_shovel · Post #868 · 03.12.2022 г., 07:30
Melbourne-based architects Adam Newman and Kelvin Tsang have installed a small scale of The Parthenon clad in different hues of colors and murals within the Grollo Equiset Garden at Melbourne’s National Gallery of Victoria (NGV), Australia. The installation, called Temple of Boom, emerges as "an evocative reimagination of The Parthenon", a global architectural icon and an Ancient Greek temple located on the Acropolis, Athens. Newman and Tsang draw inspiration from the colourful and artistic embellishments that once covered the original building over two- thousand years ago. Based on these historical references, dynamic and eye-catching floral motifs and optical illusions, designed by contemporary artists Drez, Manda Lane and David Lee Pereira wrap the installation. Images 1-2-3-4 📸 seanfennessy Image 5 📸 NGV #design#temple#parthenon#installation#intervention#arch_shovel
@blackwallp · Post #68085 · 03.04.2026 г., 05:42
#природа#река#храм#утро#nature#river#temple#morning 🎥Videowallpaper |😀Emoji |🎼Ringtone