Пример #1
0
 async def get_user_from_remote(url):
     async with httpx.AsyncClient() as client:
         res = await client.get(url)
         User.create_or_update_by_user_data_list(res.json()["users"])
Пример #2
0
 def create_or_update_from_json(path):
     with open(path, "r") as f:
         data = json.load(f)
         User.create_or_update_by_user_data_list(data["users"])