xync-schema 0.6.92.dev2__py3-none-any.whl → 0.7.1.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xync_schema/models.py +10 -0
- {xync_schema-0.6.92.dev2.dist-info → xync_schema-0.7.1.dev1.dist-info}/METADATA +2 -2
- xync_schema-0.7.1.dev1.dist-info/RECORD +8 -0
- {xync_schema-0.6.92.dev2.dist-info → xync_schema-0.7.1.dev1.dist-info}/WHEEL +1 -1
- xync_schema-0.6.92.dev2.dist-info/RECORD +0 -8
- {xync_schema-0.6.92.dev2.dist-info → xync_schema-0.7.1.dev1.dist-info}/top_level.txt +0 -0
xync_schema/models.py
CHANGED
|
@@ -4,6 +4,9 @@ from datetime import datetime
|
|
|
4
4
|
from tortoise import fields
|
|
5
5
|
from tortoise.queryset import QuerySet
|
|
6
6
|
from tortoise import Model as BaseModel
|
|
7
|
+
from tortoise.signals import pre_save
|
|
8
|
+
|
|
9
|
+
# noinspection PyUnresolvedReferences
|
|
7
10
|
from x_auth.models import (
|
|
8
11
|
Model,
|
|
9
12
|
Username as Username,
|
|
@@ -241,6 +244,13 @@ class User(TgUser, TsTrait):
|
|
|
241
244
|
# computed = ["balance"]
|
|
242
245
|
|
|
243
246
|
|
|
247
|
+
@pre_save(User)
|
|
248
|
+
async def person(_meta, user: User, _db, _updated: dict) -> None:
|
|
249
|
+
if user.person_id:
|
|
250
|
+
return
|
|
251
|
+
user.person = await Person.create(name=f"{user.first_name} {user.last_name}".strip())
|
|
252
|
+
|
|
253
|
+
|
|
244
254
|
class Gmail(Model):
|
|
245
255
|
login: str = fields.CharField(127)
|
|
246
256
|
password: str = fields.CharField(127)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xync-schema
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.1.dev1
|
|
4
4
|
Summary: XyncNet project database model schema
|
|
5
5
|
Author-email: Mike Artemiev <mixartemev@gmail.com>
|
|
6
6
|
License: EULA
|
|
@@ -9,11 +9,11 @@ Project-URL: Repository, https://gitlab.com/xync/back/schema
|
|
|
9
9
|
Requires-Python: >=3.11
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
Requires-Dist: xn-auth
|
|
12
|
-
Requires-Dist: python-dotenv
|
|
13
12
|
Provides-Extra: dev
|
|
14
13
|
Requires-Dist: build; extra == "dev"
|
|
15
14
|
Requires-Dist: pre-commit; extra == "dev"
|
|
16
15
|
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
16
|
+
Requires-Dist: python-dotenv; extra == "dev"
|
|
17
17
|
Requires-Dist: twine; extra == "dev"
|
|
18
18
|
|
|
19
19
|
## INSTALL
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
xync_schema/__init__.py,sha256=iuGuNLNesQNzMnfM2ao6QhgS-6E0LSdp2CV2c3qhubQ,379
|
|
2
|
+
xync_schema/enums.py,sha256=V0FYnenVT4gR5IN3zrAFRP2M7mHbQDoqwRl5xSI-lNc,12911
|
|
3
|
+
xync_schema/models.py,sha256=rwzCjLVnLdLMU188Zw_X9wBRho5ctmGW1OTBtl27a2c,31055
|
|
4
|
+
xync_schema/types.py,sha256=sYWjJMcwv7mjm38FnWyxWhT6Z4bGpt92BTVZrqyZ0Ic,1675
|
|
5
|
+
xync_schema-0.7.1.dev1.dist-info/METADATA,sha256=axYrJ7h-KhVEvNX8QQ7jiZqiVHSp9PERGuuqnVgJ7Ls,4075
|
|
6
|
+
xync_schema-0.7.1.dev1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
7
|
+
xync_schema-0.7.1.dev1.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
|
|
8
|
+
xync_schema-0.7.1.dev1.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
xync_schema/__init__.py,sha256=iuGuNLNesQNzMnfM2ao6QhgS-6E0LSdp2CV2c3qhubQ,379
|
|
2
|
-
xync_schema/enums.py,sha256=V0FYnenVT4gR5IN3zrAFRP2M7mHbQDoqwRl5xSI-lNc,12911
|
|
3
|
-
xync_schema/models.py,sha256=GEuDJPxST34c5NkgOlQ9jksPez4BkRiuiurqtSb16jY,30766
|
|
4
|
-
xync_schema/types.py,sha256=sYWjJMcwv7mjm38FnWyxWhT6Z4bGpt92BTVZrqyZ0Ic,1675
|
|
5
|
-
xync_schema-0.6.92.dev2.dist-info/METADATA,sha256=8dADCdN9bQWHympSgbXdCzsmLzglhK0fZYOJYPejrx0,4060
|
|
6
|
-
xync_schema-0.6.92.dev2.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
|
7
|
-
xync_schema-0.6.92.dev2.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
|
|
8
|
-
xync_schema-0.6.92.dev2.dist-info/RECORD,,
|
|
File without changes
|