xync-schema 0.6.78__tar.gz → 0.6.79__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.78
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
@@ -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
@@ -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, headers=self.auth.get("headers"), cookies=self.auth.get("cookies"))
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"
@@ -665,10 +665,10 @@ class TestEx(Model):
665
665
  updated_at: datetime | None = DatetimeSecField(auto_now=True)
666
666
 
667
667
  _icon = "test-pipe"
668
- _name = {"ex__name", "action", "ok"}
668
+ _name = {"ex_id", "action", "ok"}
669
669
 
670
670
  def repr(self, *args):
671
- return f"{self.ex.name} {self.action.name} {self.ok}"
671
+ return f"{self.ex_id} {self.action.name} {self.ok}"
672
672
 
673
673
  class Meta:
674
674
  table_description = "Test Exs"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xync-schema
3
- Version: 0.6.78
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
File without changes
File without changes
File without changes
File without changes
File without changes