xync-schema 0.6.88__py3-none-any.whl → 0.6.89__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 CHANGED
@@ -177,6 +177,7 @@ class Person(Model, TsTrait):
177
177
  user: fields.BackwardOneToOneRelation["User"]
178
178
  creds: fields.BackwardFKRelation["Cred"]
179
179
  actors: fields.BackwardFKRelation["Actor"]
180
+ pm_agents: fields.BackwardFKRelation["PmAgent"]
180
181
 
181
182
 
182
183
  class User(UserTg, TsTrait):
@@ -210,8 +211,8 @@ class User(UserTg, TsTrait):
210
211
  # investments: fields.BackwardFKRelation["Investment"]
211
212
 
212
213
  async def free_assets(self):
213
- assets = await Asset.filter(agent__actor__person__user__id=self.id).values("free", "coin__rate")
214
- return sum(asset["free"] * asset["coin__rate"] for asset in assets)
214
+ assets = await Asset.filter(agent__actor__person__user__id=self.id).values("free", "addr__coin__rate")
215
+ return sum(asset["free"] * asset["addr__coin__rate"] for asset in assets)
215
216
 
216
217
  async def fiats_sum(self):
217
218
  fiats = await Fiat.filter(cred__person__user__id=self.id).values("amount", "cred__pmcur__cur__rate")
@@ -385,6 +386,15 @@ class Pm(Model):
385
386
  # return sys.modules[module_name].PmEpyd
386
387
 
387
388
 
389
+ class PmAgent(Model):
390
+ pm: fields.ForeignKeyRelation[Pm] = fields.ForeignKeyField("models.Pm", related_name="agents")
391
+ person: fields.ForeignKeyRelation[Person] = fields.ForeignKeyField("models.Person", related_name="pm_agents")
392
+ auth: dict[str, str] = fields.JSONField(default={})
393
+
394
+ class Meta:
395
+ unique_together = (("pm_id", "person_id"),)
396
+
397
+
388
398
  class Pmcur(Model): # for fiat with no exs tie
389
399
  pm: fields.ForeignKeyRelation[Pm] = fields.ForeignKeyField("models.Pm")
390
400
  pm_id: int
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.88
3
+ Version: 0.6.89
4
4
  Summary: XyncNet project database model schema
5
5
  Author-email: Mike Artemiev <mixartemev@gmail.com>
6
6
  License: EULA
@@ -0,0 +1,8 @@
1
+ xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ xync_schema/enums.py,sha256=MM5s20GpI8gsPlPS9nYFtkyrPheTvlcDYESwjnZ4Hmg,12698
3
+ xync_schema/models.py,sha256=IOgxR8Cvwnwbd86tNciN_HMxxdu1uYjySZUh6BhrjJQ,29717
4
+ xync_schema/types.py,sha256=sYWjJMcwv7mjm38FnWyxWhT6Z4bGpt92BTVZrqyZ0Ic,1675
5
+ xync_schema-0.6.89.dist-info/METADATA,sha256=w38w1TuVYWZL_dgKsN9cqV636ou-oA4bB2xtmNbxZrc,4055
6
+ xync_schema-0.6.89.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
7
+ xync_schema-0.6.89.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
+ xync_schema-0.6.89.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.1)
2
+ Generator: setuptools (79.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,8 +0,0 @@
1
- xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- xync_schema/enums.py,sha256=MM5s20GpI8gsPlPS9nYFtkyrPheTvlcDYESwjnZ4Hmg,12698
3
- xync_schema/models.py,sha256=9nt8Tjv9E0OC9SNPTtzxFu13T7FWwC3rYYQ3aAoRWHY,29291
4
- xync_schema/types.py,sha256=sYWjJMcwv7mjm38FnWyxWhT6Z4bGpt92BTVZrqyZ0Ic,1675
5
- xync_schema-0.6.88.dist-info/METADATA,sha256=Hi8MOzjX5N9UlC5QCrXN_HD_UO8PkUmOZBahOSzCzBo,4055
6
- xync_schema-0.6.88.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
7
- xync_schema-0.6.88.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
- xync_schema-0.6.88.dist-info/RECORD,,