xync-schema 0.6.77__py3-none-any.whl → 0.6.79__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/enums.py CHANGED
@@ -144,10 +144,10 @@ class ExAction(IntEnum):
144
144
  set_pairs = 46 # обновление пар биржи в бд
145
145
  ad = 42 # Чужая объява по id
146
146
  """ Agent: Fiat """
147
- my_fiats = 25 # Список реквизитов моих платежных методов
148
- fiat_new = 26 # Создание реквизита моего платежного метода
149
- fiat_upd = 27 # Редактирование реквизита моего платежного метода
150
- fiat_del = 28 # Удаление реквизита моего платежного метода
147
+ my_creds = 25 # Список реквизитов моих платежных методов
148
+ cred_new = 26 # Создание реквизита моего платежного метода
149
+ cred_upd = 27 # Редактирование реквизита моего платежного метода
150
+ cred_del = 28 # Удаление реквизита моего платежного метода
151
151
  """ Agent: Ad """
152
152
  my_ads = 29 # Список моих объявлений
153
153
  my_ad = 43 # Моя объява по id
xync_schema/models.py CHANGED
@@ -249,6 +249,26 @@ class Actor(Model):
249
249
  ads: fields.BackwardFKRelation["Ad"]
250
250
  taken_orders: fields.BackwardFKRelation["Order"]
251
251
 
252
+ def client(self):
253
+ module_name = f"xync_client.{self.ex.name}.agent"
254
+ __import__(module_name)
255
+ client = sys.modules[module_name].AgentClient
256
+ return client(self, headers=self.agent.auth.get("headers"), cookies=self.agent.auth.get("cookies"))
257
+
258
+ def in_client(self):
259
+ import sys
260
+
261
+ module_name = f"xync_client.{self.ex.name}.inAgent"
262
+ __import__(module_name)
263
+ client = sys.modules[module_name].InAgentClient
264
+ return client(self)
265
+
266
+ def asset_client(self):
267
+ module_name = f"xync_client.{self.ex.name}.asset"
268
+ __import__(module_name)
269
+ client = sys.modules[module_name].AssetClient
270
+ return client(self)
271
+
252
272
  class Meta:
253
273
  table_description = "Actors"
254
274
  unique_together = (("ex_id", "exid"), ("ex_id", "person_id"))
@@ -266,26 +286,6 @@ class Agent(Model, TsTrait):
266
286
  # def balance(self) -> int:
267
287
  # return sum(asset.free * (asset.coin.rate or 0) for asset in self.assets)
268
288
 
269
- def client(self):
270
- module_name = f"xync_client.{self.actor.ex.name}.agent"
271
- __import__(module_name)
272
- client = sys.modules[module_name].AgentClient
273
- return client(self)
274
-
275
- # def in_client(self) -> "BaseInAgentClient":
276
- # import sys
277
- #
278
- # module_name = f"xync_client.{self.ex.name}.inAgent"
279
- # __import__(module_name)
280
- # client = sys.modules[module_name].InAgentClient
281
- # return client(self)
282
-
283
- def asset_client(self):
284
- module_name = f"xync_client.{self.actor.ex.name}.asset"
285
- __import__(module_name)
286
- client = sys.modules[module_name].AssetClient
287
- return client(self)
288
-
289
289
  # class PydanticMeta(Model.PydanticMeta):
290
290
  # max_recursion = 3
291
291
  # include = "id", "actor__ex", "auth", "updated_at"
@@ -359,7 +359,6 @@ class Pm(Model):
359
359
  bank: bool | None = fields.BooleanField(null=True)
360
360
 
361
361
  typ: PmType | None = fields.IntEnumField(PmType, null=True)
362
- logo: fields.ForeignKeyNullableRelation["File"] = fields.ForeignKeyField("models.File", "pm_logos", null=True)
363
362
 
364
363
  ads: fields.ManyToManyRelation[Ad]
365
364
  curs: fields.ManyToManyRelation[Cur]
@@ -406,17 +405,15 @@ class Pmex(BaseModel): # existence pm in ex with no cur tie
406
405
  ex_id: int
407
406
  pm: fields.ForeignKeyRelation[Pm] = fields.ForeignKeyField("models.Pm", "pmexs")
408
407
  pm_id: int
408
+ logo: fields.ForeignKeyNullableRelation["File"] = fields.ForeignKeyField("models.File", "pmex_logos", null=True)
409
+ logo_id: int
409
410
  exid: str = fields.CharField(63)
410
411
  name: str = fields.CharField(63)
411
- name_: str = fields.CharField(63, null=True)
412
412
 
413
413
  banks: fields.BackwardFKRelation["PmexBank"]
414
414
 
415
415
  class Meta:
416
- unique_together = (
417
- ("ex_id", "exid"),
418
- ("ex_id", "name_"),
419
- ) # , ("ex", "pm"), ("ex", "name") # todo: tmp removed for HTX duplicates
416
+ unique_together = (("ex_id", "exid"),) # , ("ex", "pm"), ("ex", "name") # todo: tmp removed for HTX duplicates
420
417
 
421
418
 
422
419
  class PmexBank(BaseModel): # banks for SBP
@@ -668,10 +665,10 @@ class TestEx(Model):
668
665
  updated_at: datetime | None = DatetimeSecField(auto_now=True)
669
666
 
670
667
  _icon = "test-pipe"
671
- _name = {"ex__name", "action", "ok"}
668
+ _name = {"ex_id", "action", "ok"}
672
669
 
673
670
  def repr(self, *args):
674
- return f"{self.ex.name} {self.action.name} {self.ok}"
671
+ return f"{self.ex_id} {self.action.name} {self.ok}"
675
672
 
676
673
  class Meta:
677
674
  table_description = "Test Exs"
@@ -706,6 +703,8 @@ class File(Model):
706
703
  size: bytes = fields.IntField()
707
704
  created_at: datetime | None = DatetimeSecField(auto_now_add=True)
708
705
 
706
+ pmex_logos: fields.BackwardFKRelation[Pmex]
707
+
709
708
  _icon = "file"
710
709
  _name = {"name"}
711
710
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.77
3
+ Version: 0.6.79
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=4ZNpPKY54SY34nz1APsg7wKzCIvpYWhG4sKsZ1uEmVU,12697
3
+ xync_schema/models.py,sha256=tit1QTUYuVBKx23nIbrd3l3tcveT3px7qzozq7XQj08,27725
4
+ xync_schema/types.py,sha256=jubMlsGkaLpv1QZrInP0sEKW8SgWa6TyHENDz8OEvDM,1737
5
+ xync_schema-0.6.79.dist-info/METADATA,sha256=978t-smQ6S6ElHdVf6Pt4wHsH6Lh_A4AO4VVBlBLIBs,4055
6
+ xync_schema-0.6.79.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
7
+ xync_schema-0.6.79.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
+ xync_schema-0.6.79.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- xync_schema/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- xync_schema/enums.py,sha256=tE3xRj3hWOSJvFkYMv4X5bGfAkjR7OzNmVnqj1X47Go,12697
3
- xync_schema/models.py,sha256=LO3PLB7DcRaMyKrIE0w7eY5Jhbt3AX-IRuUSBY3ApG0,27737
4
- xync_schema/types.py,sha256=jubMlsGkaLpv1QZrInP0sEKW8SgWa6TyHENDz8OEvDM,1737
5
- xync_schema-0.6.77.dist-info/METADATA,sha256=PME5UTQ_MjyhCB-JQBuDcnXRAJ3P-LJ2pS1fR-5XSTE,4055
6
- xync_schema-0.6.77.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
7
- xync_schema-0.6.77.dist-info/top_level.txt,sha256=jN8IBDfVY8b85Byyk8v0Gyj_0yLB8FO56WV4EvcXWY4,12
8
- xync_schema-0.6.77.dist-info/RECORD,,