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

Резултати

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

Пребарај: #income

当前筛选 #income清除筛选
Tesla Calls Official

@teslacallsofficial · Post #10022 · 15.03.2026 г., 20:51

🔥$INCOME Entered this position as a speculative play within the SOLANA ecosystem. Monitor pullbacks carefully, manage entries with discipline, and always conduct your own due diligence before participating. #TSLA X: https://x.com/i/communities/2033055064420659307 🔗 Contract: https://solscan.io/token/5QmbJw7mM6tcCdXVy8ftc2bu8izded7Etc57TMA2pump https://dexscreener.com/solana/C1CfVtbnUoW9y2ZgZkynn9di4eANZwqa4TPGHa7pfFFr #INCOME#SOLANA#TESLACALLS

Daily Channels

@dailychannels · Post #6201 · 12.07.2025 г., 13:00

Channel: SIGNAL Members: ~63.75K 💢 Username: @finsignal Description: About blockchain, cryptocurrency and crypto technologies. Actual entry and exit points in the cryptocurrency market. Channel: @finsignal Bot: @finsignalbot For questions contact: @finsignaladmin Advertising and schedule: @my_signal_ad_bot 🏷 Tags: #crypto_fx_trading #cryptocurrency#nft#income#business https://telegramchannels.me/channels/finsignal

International News

@intnewsagency · Post #9373 · 25.04.2026 г., 09:34

Putin Changes Income Declaration Rules for Officials Vladimir Putin signed a law requiring officials to declare the total family income—covering themselves, their spouses, and minor children—without detailed breakdowns. Pre-marriage spousal incomes are excluded but may appear in expense declarations. The law limits oversight of transactions and assets made before appointment or marriage, excluding them from inspections and penalties. #Russia#Officials#Income#Law The main news of Russia and the world ishere.

Vet_opportunities

@vet_opportunities · Post #466 · 27.04.2026 г., 07:49

🚀 Looking for LinkedIn Accounts to Rent! Do you have a LinkedIn account ? Turn it into weekly income 💰 We’re looking for accounts to help connect with professionals, clients, and decision-makers. It’s simple, safe, and fully controlled. 🔒 What you get: • Secure use (networking only) • No password changes • No illegal activity • Stop anytime, no stress 💵 Weekly payments via: • Binance • CBE • Telebirr • CBE Birr 📩 Interested? DM now 👉@tadbek Don’t forget to share 🙌 👇👇 @vet_opportunities @vet_opportunities @vet_opportunities #LinkedIn#Networking#Income#Opportunities

Vet_opportunities

@vet_opportunities · Post #439 · 11.04.2026 г., 01:14

🚀 Looking for LinkedIn Accounts to Rent! Do you have a LinkedIn account ? Turn it into weekly income 💰 We’re looking for accounts to help connect with professionals, clients, and decision-makers. It’s simple, safe, and fully controlled. 🔒 What you get: • Secure use (networking only) • No password changes • No illegal activity • Stop anytime, no stress 💵 Weekly payments via: • Binance • CBE • Telebirr • CBE Birr 📩 Interested? DM now 👉@tadbek Don’t forget to share 🙌 👇👇 @vet_opportunities @vet_opportunities @vet_opportunities #LinkedIn#Networking#Income#Opportunities

Vet_opportunities

@vet_opportunities · Post #427 · 04.04.2026 г., 02:56

🚀 Looking for LinkedIn Accounts to Rent! Do you have a LinkedIn account ? Turn it into weekly income 💰 We’re looking for accounts to help connect with professionals, clients, and decision-makers. It’s simple, safe, and fully controlled. 🔒 What you get: • Secure use (networking only) • No password changes • No illegal activity • Stop anytime, no stress 💵 Weekly payments via: • Binance • CBE • Telebirr • CBE Birr 📩 Interested? DM now 👉@tadbek Don’t forget to share 🙌 👇👇 @vet_opportunities @vet_opportunities @vet_opportunities #LinkedIn#Networking#Income#Opportunities

Vet_opportunities

@vet_opportunities · Post #407 · 23.03.2026 г., 16:54

🚀 Looking for LinkedIn Accounts to Rent! Do you have a LinkedIn account ? Turn it into weekly income 💰 We’re looking for accounts to help connect with professionals, clients, and decision-makers. It’s simple, safe, and fully controlled. 🔒 What you get: • Secure use (networking only) • No password changes • No illegal activity • Stop anytime, no stress 💵 Weekly payments via: • Binance • CBE • Telebirr • CBE Birr 📩 Interested? DM now 👉@tadbek Don’t forget to share 🙌 👇👇 @vet_opportunities @vet_opportunities @vet_opportunities #LinkedIn#Networking#Income#Opportunities

Vet_opportunities

@vet_opportunities · Post #400 · 21.03.2026 г., 17:46

🚀 Looking for LinkedIn Accounts to Rent! Do you have a LinkedIn account ? Turn it into weekly income 💰 We’re looking for accounts to help connect with professionals, clients, and decision-makers. It’s simple, safe, and fully controlled. 🔒 What you get: • Secure use (networking only) • No password changes • No illegal activity • Stop anytime, no stress 💵 Weekly payments via: • Binance • CBE • Telebirr • CBE Birr 📩 Interested? DM now 👉@tadbek Don’t forget to share 🙌 👇👇 @vet_opportunities @vet_opportunities @vet_opportunities #LinkedIn#Networking#Income#Opportunities

Vet_opportunities

@vet_opportunities · Post #396 · 20.03.2026 г., 18:22

🚀 Looking for LinkedIn Accounts to Rent! Do you have a LinkedIn account ? Turn it into weekly income 💰 We’re looking for accounts to help connect with professionals, clients, and decision-makers. It’s simple, safe, and fully controlled. 🔒 What you get: • Secure use (networking only) • No password changes • No illegal activity • Stop anytime, no stress 💵 Weekly payments via: • Binance • CBE • Telebirr • CBE Birr 📩 Interested? DM now 👉@tadbek Don’t forget to share 🙌 👇👇 @vet_opportunities @vet_opportunities @vet_opportunities #LinkedIn#Networking#Income#Opportunities

Venture Village Wall 🦄

@venturevillagewall · Post #3436 · 19.12.2024 г., 07:00

E-commerce Conversion Crisis E-commerce stores face a critical challenge with low conversion rates from social media traffic—about half of the general average. Despite this, social networks are a major traffic source, with 64% of users making purchases through them, accounting for a third of online sales. This gap presents significant revenue losses for stores that fail to convert this traffic, highlighting a potential market for platforms aimed at boosting conversions. Read more: Fastfounder #Ecommerce#Conversion#SocialMedia#Traffic#Sales#OnlineShopping#Startup#Market#Revenue#Challenges#Users#Platforms#Retail#Growth#Insights#Business#Tech#DigitalMarketing#Shopping#Income#Reports