tgshops-integrations 4.2__py3-none-any.whl → 4.3__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.
- tgshops_integrations/middlewares/gateway.py +1 -1
- tgshops_integrations/nocodb_connector/client.py +10 -0
- tgshops_integrations/nocodb_connector/products_management.py +2 -2
- {tgshops_integrations-4.2.dist-info → tgshops_integrations-4.3.dist-info}/METADATA +1 -1
- {tgshops_integrations-4.2.dist-info → tgshops_integrations-4.3.dist-info}/RECORD +7 -7
- {tgshops_integrations-4.2.dist-info → tgshops_integrations-4.3.dist-info}/WHEEL +0 -0
- {tgshops_integrations-4.2.dist-info → tgshops_integrations-4.3.dist-info}/top_level.txt +0 -0
@@ -127,7 +127,7 @@ class Gateway(NocodbClient):
|
|
127
127
|
special_attributes=self.special_attributes,
|
128
128
|
)
|
129
129
|
if current_hash != existing_hash:
|
130
|
-
await self.product_manager.update_product(product=product)
|
130
|
+
await self.product_manager.update_product(product=product,data_check=self.category_manager.categories)
|
131
131
|
else:
|
132
132
|
checked_data = dump_product_data_with_check(
|
133
133
|
data=product,
|
@@ -92,6 +92,16 @@ class NocodbClient:
|
|
92
92
|
if response.status_code == 200:
|
93
93
|
return response.json()
|
94
94
|
raise Exception(response.text)
|
95
|
+
|
96
|
+
async def update_table_record(self, table_name: str, record_id: str, updated_data: dict) -> bool:
|
97
|
+
url = f"{self.NOCODB_HOST}/tables/{table_name}/records"
|
98
|
+
updated_data["id"] = int(record_id)
|
99
|
+
if updated_data["ID"]:
|
100
|
+
updated_data.pop("ID")
|
101
|
+
response = await self.httpx_client.patch(url, json=updated_data)
|
102
|
+
if response.status_code == 200:
|
103
|
+
return True
|
104
|
+
raise Exception(response.text)
|
95
105
|
|
96
106
|
async def create_table_record(self, table_name: str, record: dict) -> dict:
|
97
107
|
"""
|
@@ -98,11 +98,11 @@ class ProductManager(NocodbClient):
|
|
98
98
|
)
|
99
99
|
return [parse_product_data(record) for record in records]
|
100
100
|
|
101
|
-
async def update_product(self, product: ProductModel):
|
101
|
+
async def update_product(self, product: ProductModel,data_check=[]):
|
102
102
|
"""
|
103
103
|
Updates an existing product in the table.
|
104
104
|
"""
|
105
|
-
data = dump_product_data_with_check(data=product, data_check=
|
105
|
+
data = dump_product_data_with_check(data=product, data_check=data_check)
|
106
106
|
await self.update_table_record(
|
107
107
|
table_name=self.products_table,
|
108
108
|
record_id=product.id,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: tgshops-integrations
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.3
|
4
4
|
Summary: Library is intended to provide the integration of the external service or CRM system with the TelegramShops/It allows to configure the relationship between NocoDB list of the products used further to display in the shop/As a resultss the products can be synchronized and updated uppon the request.
|
5
5
|
Home-page: https://git.the-devs.com/virtual-shops/shop-system/shop-backend-integrations/integration-library/integration-library
|
6
6
|
Author: Dimi Latoff
|
@@ -1,16 +1,16 @@
|
|
1
1
|
tgshops_integrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
tgshops_integrations/middlewares/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
|
-
tgshops_integrations/middlewares/gateway.py,sha256=
|
3
|
+
tgshops_integrations/middlewares/gateway.py,sha256=i52fWazVxsoUQIMkWBstdTpezC6Gfq5hXkSctaKxncA,6343
|
4
4
|
tgshops_integrations/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
tgshops_integrations/models/categories.py,sha256=EG6C8g5dOfXB2MH-vtqH13aqB7_VyOobY2FHpDb-fsY,977
|
6
6
|
tgshops_integrations/models/products.py,sha256=4XC6fyC91TAWj5oaX0A26kT_UizZIGaf4qyrVv9lPpQ,1403
|
7
7
|
tgshops_integrations/nocodb_connector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
tgshops_integrations/nocodb_connector/categories_management.py,sha256=w2BygSOEAQcyRMvszttsRDldP2G2HN2YBlm2MjdN1HE,7481
|
9
|
-
tgshops_integrations/nocodb_connector/client.py,sha256=
|
9
|
+
tgshops_integrations/nocodb_connector/client.py,sha256=3MLTOLInxhsr4H0nt71k09ozgUyRzGV2onYZuFWQJzI,12487
|
10
10
|
tgshops_integrations/nocodb_connector/model_mapping.py,sha256=UY6QHCba8o8J28duCgAzx95agGlE1pLagkNdZLV5nro,8719
|
11
|
-
tgshops_integrations/nocodb_connector/products_management.py,sha256=
|
11
|
+
tgshops_integrations/nocodb_connector/products_management.py,sha256=q0zrlybfnnXeAiqDpchV_zq4BoMJUS6q2zid1eshSM0,6179
|
12
12
|
tgshops_integrations/nocodb_connector/tables.py,sha256=ha_QXZXd93mht0fR5E1nM0wUpz1ePon-pIdO2HI67l8,356
|
13
|
-
tgshops_integrations-4.
|
14
|
-
tgshops_integrations-4.
|
15
|
-
tgshops_integrations-4.
|
16
|
-
tgshops_integrations-4.
|
13
|
+
tgshops_integrations-4.3.dist-info/METADATA,sha256=U7Ympcs1RS8PbXnabXORAwAD8w3bzW_ZKeiEmty4qBQ,2844
|
14
|
+
tgshops_integrations-4.3.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
15
|
+
tgshops_integrations-4.3.dist-info/top_level.txt,sha256=HFNtxqDpzmlF4ZLnMiwhbU7pOa_YozxU2zBl0bnUmcY,21
|
16
|
+
tgshops_integrations-4.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|