tgshops-integrations 1.9__py3-none-any.whl → 2.1__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.
@@ -8,7 +8,7 @@ from tgshops_integrations.nocodb_connector.client import NocodbClient
8
8
 
9
9
  from tgshops_integrations.nocodb_connector.model_mapping import dump_product_data,dump_product_data_with_check, get_pagination_info, ID_FIELD, \
10
10
  parse_product_data, PRODUCT_CATEGORY_ID_LOOKUP_FIELD, PRODUCT_NAME_FIELD, PRODUCT_PRICE_FIELD, \
11
- PRODUCT_STOCK_FIELD,PRODUCT_IMAGES_LOOKUP_FIELD
11
+ PRODUCT_STOCK_FIELD, PRODUCT_IMAGES_LOOKUP_FIELD
12
12
 
13
13
  from tgshops_integrations.nocodb_connector.categories import CategoryManager
14
14
  from tgshops_integrations.nocodb_connector.products import ProductManager
@@ -111,6 +111,7 @@ def dump_product_data(data: ProductModel) -> dict:
111
111
  PRODUCT_CURRENCY_FIELD: data.currency,
112
112
  PRODUCT_STOCK_FIELD: data.stock_qty,
113
113
  PRODUCT_CATEGORY_NAME_FIELD:[data.category_name] if data.category_name else None,
114
+ #TODO category parameter is deprecated
114
115
  PRODUCT_CATEGORY_ID_FIELD: [{'Id': data.category}] if data.category else None,
115
116
  PRODUCT_IMAGE_FIELD: preview_url,
116
117
  PRODUCT_DISCOUNT_PRICE_FIELD: data.final_price
@@ -136,7 +137,7 @@ def dump_product_data_with_check(data: ProductModel, data_check: dict) -> dict:
136
137
  PRODUCT_CURRENCY_FIELD: data.currency,
137
138
  PRODUCT_STOCK_FIELD: data.stock_qty,
138
139
  PRODUCT_CATEGORY_NAME_FIELD:[data.category_name] if data.category_name else None,
139
- PRODUCT_CATEGORY_ID_FIELD: [{'Id': data_check[item]} for item in data.category_name] if data.category else None,
140
+ PRODUCT_CATEGORY_ID_FIELD: [{'Id': data_check[item]} for item in data.category_name] if data.category_name else None,
140
141
  PRODUCT_IMAGE_FIELD: preview_url,
141
142
  PRODUCT_CHECKOUT_MODE: NOCODB_CHECKOUT_MODES,
142
143
  PRODUCT_DISCOUNT_PRICE_FIELD: data.final_price,
@@ -31,11 +31,9 @@ class ProductManager(NocodbClient):
31
31
  def hash_product(self,product,special_attributes=False):
32
32
  if special_attributes:
33
33
  hash_string = ''.join(attr.description for attr in product.extra_attributes if attr.name.endswith('*'))
34
- # hash_string = f"{product.external_id}{product.price}{product.category_name.sort()}{product.name}{product.description}"
35
34
  else:
36
35
  # Concatenate relevant attributes into a single string
37
36
  hash_string = f"{product.external_id}{product.price}{product.category_name.sort()}{product.name}{product.description}"
38
- # hash_string = f"{product.external_id}{product.price}{product.category_name}{product.name}{product.description}{product.preview_url}"
39
37
  # Hash the concatenated string
40
38
  hash_object = hashlib.sha256(hash_string.encode())
41
39
  hex_dig = hash_object.hexdigest()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tgshops-integrations
3
- Version: 1.9
3
+ Version: 2.1
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=9IlVtShec1rZ9SEX0rkJgv8IjJFU-lthWAoNAZ4_idg,6366
3
+ tgshops_integrations/middlewares/gateway.py,sha256=Fj7pnFcVxKmrFU4dRN5RI23lM4gG61In7X2fybudS3o,6368
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=i0vP_eJMVCB-W25BCoodIB0AhsMTqYiDO48N-B6Ueo0,1379
7
7
  tgshops_integrations/nocodb_connector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  tgshops_integrations/nocodb_connector/categories.py,sha256=x9mtXYEEIt6jV1Qzh_hYwKYJjqyuWyopmyeV0V4myUQ,9069
9
9
  tgshops_integrations/nocodb_connector/client.py,sha256=RD8UDS4AXrN1GFmjakZsdTGbP_u2bsoxfopq7UV6MT0,11725
10
- tgshops_integrations/nocodb_connector/model_mapping.py,sha256=kY8M-VulNC58mhEFZHsr1MziKboMmL8lA4kCiTZI9r4,8867
11
- tgshops_integrations/nocodb_connector/products.py,sha256=23uXnmznJN6fZw3tZ3a7dJg06LkI2QaNfVhSKochPn4,8677
10
+ tgshops_integrations/nocodb_connector/model_mapping.py,sha256=nsul7OjUHgGhpV-iwwaAvb9SnBlwj4evHDcXSd-v1zk,8919
11
+ tgshops_integrations/nocodb_connector/products.py,sha256=AwmRT_SEgxLDf0K-lkGzFzC4PXYuZdUILIQo-UZpi9M,8401
12
12
  tgshops_integrations/nocodb_connector/tables.py,sha256=ha_QXZXd93mht0fR5E1nM0wUpz1ePon-pIdO2HI67l8,356
13
- tgshops_integrations-1.9.dist-info/METADATA,sha256=7lrCDKwjgnaELU63uxEKIut76DGrMEqJyRCiO4MQjfI,2774
14
- tgshops_integrations-1.9.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
15
- tgshops_integrations-1.9.dist-info/top_level.txt,sha256=HFNtxqDpzmlF4ZLnMiwhbU7pOa_YozxU2zBl0bnUmcY,21
16
- tgshops_integrations-1.9.dist-info/RECORD,,
13
+ tgshops_integrations-2.1.dist-info/METADATA,sha256=nOCXu9-T7P1I2Y3rTupBEgDicmBA6a6JnHVRb49LY7E,2774
14
+ tgshops_integrations-2.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
15
+ tgshops_integrations-2.1.dist-info/top_level.txt,sha256=HFNtxqDpzmlF4ZLnMiwhbU7pOa_YozxU2zBl0bnUmcY,21
16
+ tgshops_integrations-2.1.dist-info/RECORD,,