@pjapk_vpn · Post #8914 · 23.12.2025 г., 11:10
#VPN#Hotspot@PJAPK 👥频道💬群聊🤖投稿
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
Пребарај: #hotspot
@pjapk_vpn · Post #8914 · 23.12.2025 г., 11:10
#VPN#Hotspot@PJAPK 👥频道💬群聊🤖投稿
@pjapk_vpn · Post #8370 · 28.09.2025 г., 02:37
#VPN#Hotspot 👥频道💬群聊🤖投稿
@pjapk_vpn · Post #8065 · 10.08.2025 г., 13:41
#VPN#Hotspot 👥频道💬群聊🤖投稿
@lsposed_Modules_Updates_Trackers · Post #6606 · 17.04.2026 г., 18:30
#Hotspot#Lev_Gorodetskii 模块:io.drsr.hotspotadb 简介:Hotspot Wireless Debugging 版本:4-1.1.0 更新时间:2026/04/18 01:44:11 更新日志: Added Added "Fixed IP/port" toggle on the Wireless Debugging screen to listen on 192.168.49.1:5555. Fixed Various UI sync and lifecycle issues on Settings screens. @lsposed_Modules_Updates_Trackers | @lsposed_Geeks_Bot
Hashtags
@lsposed_Modules_Updates_Trackers · Post #6553 · 12.04.2026 г., 23:30
#Hotspot#Lev_Gorodetskii 模块:io.drsr.hotspotadb 简介:Hotspot Wireless Debugging 版本:3-1.0.2 更新时间:2026/04/13 06:51:53 更新日志: Added Added support for Android 16. @lsposed_Modules_Updates_Trackers | @lsposed_Geeks_Bot
Hashtags
@lsposed_Modules_Updates_Trackers · Post #6529 · 10.04.2026 г., 16:30
#Hotspot#Lev_Gorodetskii 模块:io.drsr.hotspotadb 简介:Hotspot Wireless Debugging 版本:2-1.0.1 更新时间:2026/04/10 23:45:11 更新日志: Fixed Fixed wrong IP shown on Wireless Debugging screen when hotspot is active. Fixed button label not updating on hotspot/Wi-Fi state changes. @lsposed_Modules_Updates_Trackers | @lsposed_Geeks_Bot
Hashtags
@amazingeo · Post #710 · 13.05.2026 г., 20:31
🌍 The Tumbes-Chocó-Magdalena hotspot, stretching along the Pacific coast of Ecuador and Colombia, shelters at least 2,500 plant species found nowhere else and dozens of rare amphibians. ✨ #biodiversity⚡#hotspot⚡#rainforest⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels
@ULTIMORAPOLITICS · Post #44392 · 28.11.2023 г., 17:03
Cosa prevede il Decreto #Immigrazione approvato oggi alla #Camera? 📌si estende anche ai cittadini stranieri lungosoggiornanti (in Italia da almeno 5 anni con permesso di soggiorno) la possibilità di espulsione per motivi di pubblica sicurezza (prima era solo per i non lungosoggiornanti). 📌basterà un silenzio assenso dell’autorità giudiziaria per ottenere il nullaosta, dopo una settimana, per espellere lo straniero destinatario di una misura di espulsione per pericolosità sociale. 📌+20 unità della polizia di stato in ambasciate e consolati per potenziare il controllo sulla regolarità dei visti in ingresso. 📌non sarà più possibile eludere l’espulsione reiterando la domanda di protezione internazionale già bocciata in precedenza, perché il Presidente della Commissione territoriale analizzerà in via preferenziale queste domande, velocizzando i tempi. 📌se lo straniero, appena sbarca, dichiara di voler fare domanda di protezione internazionale, ma poi non la formalizza, il procedimento è considerato non instaurato, quindi se rintracciato lo si può espellere. Se si aggiunge l’allontanamento ingiustificato dai centri di accoglienza, si riduce da 12 a 9 mesi la sospensione della domanda. 📌in caso di rilevante afflusso, il prefetto può assegnare i minori non accompagnati over16 ai centri di accoglienza degli adulti, per un periodo non superiore a 90 giorni. 📌in caso di arrivi consistenti, le autorità di pubblica sicurezza possono disporre una valutazione antropometrica o accertamenti radiografici per calcolare l’età dell’immigrato. Se il risultato non corrisponde all’età dichiarata, c’è l’espulsione. La procedura deve concludersi entro 60 giorni. 📌la verifica dei requisiti della regolarità dei contratti di lavoro offerti ai minori che compiono 18 anni, tale per cui si può convertire il permesso di soggiorno in cittadinanza, potrà essere effettuata anche dagli ispettori del lavoro. 📌in casi di grandi flussi e indisponibilità di posti, si può andare in deroga al rispetto dei limiti di capienza dei centri per i minori stranieri non accompagnati. 📌si estende la categoria di vulnerabilità, con conseguente accessibilità al sistema SAI, a tutte le donne (prima era solo per le donne in gravidanza) 📌fino a tutto il 2025 il servizio di raccolta e smaltimento dei rifiuti negli #hotspot sarà assicurato dallo Stato tramite i prefetti e non demandato al singolo Comune @UltimoraPolitics
Hashtags
@amazingeo · Post #101 · 23.08.2025 г., 09:12
🌍 The Western Ghats in India are a global biodiversity hotspot, home to more than 300 unique species of butterflies and over 500 types of trees found nowhere else on Earth. ✨ #biodiversity⚡#India⚡#hotspot⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍
@amazingeo · Post #81 · 20.08.2025 г., 03:12
🌍 Madagascar is a biodiversity hotspot with thousands of plant and animal species found nowhere else on Earth. Over 90% of its wildlife is unique to the island. ✨ #biodiversity⚡#Madagascar⚡#hotspot⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography🌍
@amazingeo · Post #514 · 14.12.2025 г., 20:31
🌍 The island of Socotra in the Arabian Sea is a biodiversity hotspot with over a third of its 800 plant species found nowhere else, including the iconic dragon’s blood tree with its umbrella-like canopy. ✨ #biodiversity⚡#hotspot⚡#islands⚡#plants⚡#geography⚡#nature⚡#earth 👉subscribe Amazing Geography 👉more Channels