xync-db 0.6.0__tar.gz → 0.6.1.dev1__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.
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/PKG-INFO +1 -1
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/0001_initial.py +7 -6
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/models/CLAUDE.md +3 -3
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/models/__init__.py +12 -8
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/.gitignore +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/README.md +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/pyproject.toml +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/__init__.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/config.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/enums.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/exceptions.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/graph.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/i18n.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/login_store.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/logo.png +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/CLAUDE.md +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/__init__.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/0002_triggers.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/0003_seed.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/__init__.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/__init__.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/a_actor_seed.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/a_bin_seed.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/a_city_seed.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/a_country_seed.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/a_tg_seed.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/b_htx_seed.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/c_net_seed.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/cities.json +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/countries.json +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/ranges.csv +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/migrations/models/seed/xync_files.sql +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/py.typed +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/shared.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/typs/__init__.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/typs/db/__init__.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/typs/db/actor.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/typs/db/ad.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/typs/db/common.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/typs/db/cred.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/typs/db/order.py +0 -0
- {xync_db-0.6.0 → xync_db-0.6.1.dev1}/src/xync_db/typs/db/pm.py +0 -0
|
@@ -759,15 +759,16 @@ class Migration(migrations.Migration):
|
|
|
759
759
|
),
|
|
760
760
|
),
|
|
761
761
|
(
|
|
762
|
-
"
|
|
763
|
-
fields.
|
|
762
|
+
"cash_cities",
|
|
763
|
+
fields.ManyToManyField(
|
|
764
764
|
"models.City",
|
|
765
|
-
|
|
766
|
-
null=True,
|
|
765
|
+
unique=True,
|
|
767
766
|
db_constraint=True,
|
|
768
|
-
|
|
767
|
+
through="cond_cities",
|
|
768
|
+
forward_key="city_id",
|
|
769
|
+
backward_key="cond_parsed_id",
|
|
769
770
|
related_name="conds",
|
|
770
|
-
on_delete=OnDelete.
|
|
771
|
+
on_delete=OnDelete.CASCADE,
|
|
771
772
|
),
|
|
772
773
|
),
|
|
773
774
|
("slavic", fields.BooleanField(null=True)),
|
|
@@ -76,11 +76,11 @@ Re-exported models from `x_auth`: `Username`, `Proxy`, `Dc`, `Fcm`, `App`, `Sess
|
|
|
76
76
|
|
|
77
77
|
- `Cond.raw_txt` = текст условия (до 4095); условие — одной стороны, без объяв не живёт (D-18)
|
|
78
78
|
- `CondParsed` = structured parse result: `from_party` / `to_party` (`PartyType`: с чьего / на чей счёт идёт платёж
|
|
79
|
-
покупателя), `lk` (лк банка на руках: True — требование к тейкеру, False — есть у мейкера), `
|
|
80
|
-
кэш-обменника / встречи), `ppo`, `slip` (`Slip`) — требует/шлёт понятно из направления объявы, abuse flags,
|
|
79
|
+
покупателя), `lk` (лк банка на руках: True — требование к тейкеру, False — есть у мейкера), `cash_cities` (`City`
|
|
80
|
+
кэш-обменника / встречи — m2m `cond_cities`, их может быть несколько), `ppo`, `slip` (`Slip`) — требует/шлёт понятно из направления объявы, abuse flags,
|
|
81
81
|
`is_intermediary` (мейкер-посредник «треугол»), linked bank `Pm`s
|
|
82
82
|
— все поля nullable, дефолт `None` (= «в условии не сказано»; никаких `*.no`-заглушек). Единый writer
|
|
83
|
-
`CondParsed.upsert(cond_id, bank_ids=None, **fields)` (бот-разметка /cond и разбор нейронками, D-19); ответ админа
|
|
83
|
+
`CondParsed.upsert(cond_id, bank_ids=None, city_ids=None, **fields)` (бот-разметка /cond и разбор нейронками, D-19); ответ админа
|
|
84
84
|
на «сохранить разбор?» — эмиттер `CondParsed.answer(cond_id, remark=None)` → pg-канал `cond_ai_answer`
|
|
85
85
|
`[cond_id, remark]` (null — «да», текст — «нет» с замечанием, "" — «нет», замечание пишется, true — «🔄»: объяву
|
|
86
86
|
условия заново с биржи — реальный exid замаскированного мейкера + свежий `raw_txt`, затем вопрос заново; false —
|
|
@@ -1476,9 +1476,10 @@ class CondParsed(Model, TsTrait):
|
|
|
1476
1476
|
ppo: int = UInt1Field(null=True) # Payments per order
|
|
1477
1477
|
slip: Slip = IntEnumField(Slip, null=True)
|
|
1478
1478
|
abuser: AbuserType | None = IntEnumField(AbuserType, null=True)
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1479
|
+
# кэш-обменник / встреча за наличные в этих городах
|
|
1480
|
+
cash_cities: ManyToManyRelation[City] = ManyToManyField(
|
|
1481
|
+
"models.City", "cond_cities", related_name="conds", on_update=CASCADE
|
|
1482
|
+
)
|
|
1482
1483
|
slavic: bool = BooleanField(null=True)
|
|
1483
1484
|
cred: CredType | None = IntEnumField(
|
|
1484
1485
|
CredType, null=True
|
|
@@ -1497,14 +1498,17 @@ class CondParsed(Model, TsTrait):
|
|
|
1497
1498
|
table = "cond_parsed"
|
|
1498
1499
|
|
|
1499
1500
|
@classmethod
|
|
1500
|
-
async def upsert(
|
|
1501
|
+
async def upsert(
|
|
1502
|
+
cls, cond_id: int, bank_ids: list[int] | None = None, city_ids: list[int] | None = None, **fields
|
|
1503
|
+
) -> CondParsed:
|
|
1501
1504
|
"""ЕДИНСТВЕННЫЙ writer разбора условия: бот-разметка /cond (по полю) и Gemini (lens.parse_conds_admin,
|
|
1502
|
-
целиком). bank_ids: None —
|
|
1505
|
+
целиком). bank_ids / city_ids: None — не трогаем, список — заменяем им cond_banks / cond_cities."""
|
|
1503
1506
|
async with in_transaction():
|
|
1504
1507
|
cp, _ = await cls.update_or_create(fields, cond_id=cond_id)
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
+
for rel, model, ids in ((cp.banks, Pm, bank_ids), (cp.cash_cities, City, city_ids)):
|
|
1509
|
+
if ids is not None:
|
|
1510
|
+
await rel.clear()
|
|
1511
|
+
await rel.add(*await model.filter(id__in=ids))
|
|
1508
1512
|
return cp
|
|
1509
1513
|
|
|
1510
1514
|
@classmethod
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|