@zayuTV · Post #61 · 06.10.2020 г., 10:37
#AGA
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
Пребарај: #aga
@zayuTV · Post #61 · 06.10.2020 г., 10:37
#AGA
Hashtags
@uxlink_community · Post #518 · 14.06.2025 г., 09:19
UXLINK Season 4 Airdrop Event & 2025 H1 Business Review Dear UXLINK Global Community, We are pleased to share our comprehensive 2025 first-half business review and announce the launch of the Season 4 Airdrop Event, designed to recognize and reward our valued contributors. 2025 H1 Key Achievements - User Growth: Reached 55 million registered users globally, solidifying our position as the #1 social platform in Web3. - Ecosystem Expansion: Partnered with over 500 organizations to drive innovation across the Web3 landscape. - Social Media Presence: Grew our TikTok user base to 1 million, enhancing engagement with broader audiences. - AI Integration: The AI Growth Agent (AGA) now supports 100,000+ social users and influencers, streamlining growth strategies for creators and startups. - Onchain Leadership: Maintained the #1 ranking in ETH ecosystem for $UXLINK and $UXUY holders, reflecting strong community trust. - Financial Performance: Achieved 12 consecutive months of profit growth and established strategic reserves of $BTC and $UXLINK to ensure long-term stability. - PayFi Ecosystem: Accelerated adoption of $UXLINK in daily transactions, with FujiCard undergoing public testing in over 10 countries. - Investment Milestone: Welcomed new strategic and long-term investors, reinforcing confidence in our vision for AI-powered Web3 infrastructure. Season 4 Airdrop Event: Reward Categories The Season 4 Airdrop is designed to recognize contributors across the following categories: 1. Influencer Starlink X influencers who drive adoption of AI Growth Agent(AGA) and create content promoting #UXLINK Season 4 & AGA. 2. PayFi Early Adopters Participants in the FujiCard public test (launching in Korea). 3. Social Club Card Phase 2 Users in Japan, Korea, Indonesia, and Vietnam are eligible for Phase 2 access to the Social Club Card. Partnership Task Achievers 4. Top yappers on the UXLINK Kaito Leaderboard and Kaito eco qualified users. How to Participate The Season 4 official website is now live at https://dapp.uxlink.io/season4. Visit to explore reward details, join ongoing initiatives, and contribute to building the UXLINK AI-powered Web3 Social Platform & Infrastructure. For questions or updates, follow us on X or join official Telegram groups and stay tuned for further announcements. #UXLINKSeason4#Airdrops#AGA Sincerely, The UXLINK Community
@uxlink_community · Post #514 · 10.06.2025 г., 07:13
Excited to partner with @PublicAI_ to innovate in AI and blockchain!🤝 PublicAI leverages 800k verified contributors for premium AI training data. Backed by @solana and @NEARProtocol Foundation & Stanford Blockchain Accelerator, secured $11M business revenue. #UXLINK AI Growth Agent will elevate AI training data quality together. 🚀 #AIAgent#PublicAI#AGA