@ChrisBrownfans2020 · Post #3562 · 15.06.2025 г., 18:17
📈#ChrisBrown’s “Holy Blindfold” becomes one of his biggest streaming debuts. It received 1,274,313 streams in its accumulative day of tracking on Spotify.
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
Пребарај: #chrisbrown
@ChrisBrownfans2020 · Post #3562 · 15.06.2025 г., 18:17
📈#ChrisBrown’s “Holy Blindfold” becomes one of his biggest streaming debuts. It received 1,274,313 streams in its accumulative day of tracking on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3409 · 26.10.2024 г., 22:34
📈#ChrisBrown’s “Residuals” has now surpassed 40 Million Spotify streams! @chrisbrown where’s the music video? 🤔
Hashtags
@ChrisBrownfans2020 · Post #3391 · 07.10.2024 г., 15:12
📈#ChrisBrown’s “Residuals” has moved up to #60 on Billboard Radio Songs charts.
Hashtags
@ChrisBrownfans2020 · Post #3326 · 22.07.2024 г., 23:29
📈#ChrisBrown’s ‘11:11’ has just reached 700 Million Spotify streams 🎉
Hashtags
@ChrisBrownfans2020 · Post #3241 · 09.06.2024 г., 03:44
5 years ago today, Chris Brown released “No Guidance” featuring Drake #ChrisBrown
Hashtags
@ChrisBrownfans2020 · Post #3206 · 14.05.2024 г., 14:33
📈#ChrisBrown’s ‘11:11’ tour ticks off next month. What song would you like to be the opener? ⬇️
Hashtags
@ChrisBrownfans2020 · Post #3203 · 13.05.2024 г., 03:46
📈#ChrisBrown’s ‘Delusional’ and ‘Residuals’ have both now surpassed 5 Million streams on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3131 · 05.03.2024 г., 05:34
📈🚨#ChrisBrown’s ‘11:11 Tour’ is upon us!! Billboards are being placed across multiple Arenas in USA displaying 11:11
Hashtags
@ChrisBrownfans2020 · Post #3099 · 27.01.2024 г., 23:14
#ChrisBrown’s ‘Angel Numbers / Ten Toes’ has surpassed 70 Million streams on Spotify.
Hashtags
@ChrisBrownfans2020 · Post #3086 · 09.01.2024 г., 23:53
#ChrisBrown’s ‘Angel Numbers / Ten Toes’ has reached 50 Million Spotify streams 🎉
Hashtags
@ChrisBrownfans2020 · Post #3059 · 13.12.2023 г., 02:15
🚨Kanye West and Ty Dolla Sign will release their album ‘Vultures’ this Friday. #ChrisBrown on Track 5.
Hashtags
@ChrisBrownfans2020 · Post #3543 · 27.03.2025 г., 14:05
🚨 Chris Brown just announced his Stadium World Tour, "Breezy Bowl XX," in celebration of his 20th career anniversary. The tour will take place in Europe and North America, featuring special guests Summer Walker and Bryson Tiller. #Chrisbrown#breezybowl
Hashtags