From 1bd0b6e78e2f4b431b415b4a942607d582b57bdb Mon Sep 17 00:00:00 2001 From: kiriharu Date: Sun, 17 Jan 2021 18:08:17 +0300 Subject: [PATCH] added tortoise as dependency, for settings update --- apps/tgbot/pyproject.toml | 1 + apps/tgbot/tgbot/models/__init__.py | 0 apps/tgbot/tgbot/models/user.py | 7 +++++++ 3 files changed, 8 insertions(+) create mode 100644 apps/tgbot/tgbot/models/__init__.py create mode 100644 apps/tgbot/tgbot/models/user.py diff --git a/apps/tgbot/pyproject.toml b/apps/tgbot/pyproject.toml index f05b478..445b37b 100644 --- a/apps/tgbot/pyproject.toml +++ b/apps/tgbot/pyproject.toml @@ -13,6 +13,7 @@ core = {path = "../core"} aioinflux = "^0.9.0" loguru = "^0.5.3" whois-vu = "^0.3.0" +tortoise-orm = "^0.16.19" [tool.poetry.dev-dependencies] diff --git a/apps/tgbot/tgbot/models/__init__.py b/apps/tgbot/tgbot/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/tgbot/tgbot/models/user.py b/apps/tgbot/tgbot/models/user.py new file mode 100644 index 0000000..dc9252b --- /dev/null +++ b/apps/tgbot/tgbot/models/user.py @@ -0,0 +1,7 @@ +from tortoise import fields, Model + + +class User(Model): + telegram_id = fields.IntField(pk=True) + created_at = fields.DatetimeField(auto_now_add=True) + updated_at = fields.DatetimeField(auto_now=True)