trex-model 1.4.4__tar.gz → 1.4.5__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.
Potentially problematic release.
This version of trex-model might be problematic. Click here for more details.
- {trex-model-1.4.4 → trex-model-1.4.5}/PKG-INFO +1 -1
- {trex-model-1.4.4 → trex-model-1.4.5}/setup.py +1 -1
- {trex-model-1.4.4 → trex-model-1.4.5}/trex_model.egg-info/PKG-INFO +1 -1
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/product_models.py +7 -6
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/user_models.py +21 -8
- {trex-model-1.4.4 → trex-model-1.4.5}/LICENSE +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/MANIFEST.in +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/README.md +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/setup.cfg +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trex_model.egg-info/SOURCES.txt +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trex_model.egg-info/dependency_links.txt +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trex_model.egg-info/requires.txt +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trex_model.egg-info/top_level.txt +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/__init__.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/conf.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/__init__.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/__init__.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/admin_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/analytic_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/app_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/coporate_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/customer_model_helpers.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/customer_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/import_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/inventory_model.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/loyalty_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/marketing_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/membership_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/merchant_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/message_model_helper.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/message_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/model_decorators.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/ndb_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/pos_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/prepaid_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/program_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/rating_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/recruit_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/redeem_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/referral_program_model.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/reward_model_helpers.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/reward_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/system_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/task_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/test_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/transaction_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/voucher_models.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/merchant_helpers.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/model_decorator.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/prepaid_helpers.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/pos_conf.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/program_conf.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/utils/__init__.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/utils/gcloud/__init__.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/utils/gcloud/datastore_util.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/utils/model/__init__.py +0 -0
- {trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/utils/model/model_util.py +0 -0
|
@@ -382,7 +382,7 @@ class Product(ProductBase, FullTextSearchable):
|
|
|
382
382
|
product_sku = ndb.StringProperty(required=True)
|
|
383
383
|
product_name = ndb.StringProperty(required=True)
|
|
384
384
|
product_desc = ndb.StringProperty(required=False)
|
|
385
|
-
category_key = ndb.StringProperty(required=False)
|
|
385
|
+
category_key = ndb.StringProperty(required=False)
|
|
386
386
|
|
|
387
387
|
barcode = ndb.StringProperty(required=False)
|
|
388
388
|
|
|
@@ -408,7 +408,8 @@ class Product(ProductBase, FullTextSearchable):
|
|
|
408
408
|
|
|
409
409
|
fulltextsearch_field_name = 'product_name'
|
|
410
410
|
|
|
411
|
-
dict_properties = ['product_sku', 'product_name', 'category_key', 'price', 'cost',
|
|
411
|
+
dict_properties = ['product_sku', 'product_name', 'category_key', 'price', 'cost',
|
|
412
|
+
'product_desc', 'barcode', 'pos_settings', 'tax_details', 'product_modifier']
|
|
412
413
|
|
|
413
414
|
@property
|
|
414
415
|
def product_default_image(self):
|
|
@@ -434,6 +435,7 @@ class Product(ProductBase, FullTextSearchable):
|
|
|
434
435
|
'label' : self.product_name,
|
|
435
436
|
'desc' : self.product_desc,
|
|
436
437
|
'price' : self.price,
|
|
438
|
+
'category_key' : self.category_key,
|
|
437
439
|
'barcode' : self.barcode,
|
|
438
440
|
'modifiers' : modifier_setting_list_for_pos,
|
|
439
441
|
'representation_on_pos' : self.pos_settings,
|
|
@@ -780,10 +782,9 @@ class ProductCatalogue(ProductBase):
|
|
|
780
782
|
return total_count
|
|
781
783
|
|
|
782
784
|
def publish(self):
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
self.put()
|
|
785
|
+
self.published_menu_settings = self.setting_details_for_pos
|
|
786
|
+
self.is_publish = True
|
|
787
|
+
self.put()
|
|
787
788
|
|
|
788
789
|
def unpublish(self):
|
|
789
790
|
self.is_publish = False
|
|
@@ -6,7 +6,7 @@ Created on 10 Apr 2020
|
|
|
6
6
|
from google.cloud import ndb
|
|
7
7
|
from trexmodel.models.datastore.ndb_models import BaseNModel, DictModel
|
|
8
8
|
from trexlib.utils.string_util import random_number, random_string,\
|
|
9
|
-
is_empty
|
|
9
|
+
is_empty, is_not_empty
|
|
10
10
|
from flask_login import UserMixin
|
|
11
11
|
import logging
|
|
12
12
|
from trexlib.utils.security_util import generate_user_id, hash_password
|
|
@@ -37,14 +37,14 @@ class UserMin(BaseNModel, DictModel, UserMixin):
|
|
|
37
37
|
|
|
38
38
|
locked = ndb.BooleanProperty(required=False, default=False)
|
|
39
39
|
lock_expiry_datetime = ndb.DateTimeProperty(required=False)
|
|
40
|
-
active = ndb.BooleanProperty(required=True, default=True)
|
|
40
|
+
active = ndb.BooleanProperty(required=True, default=True)
|
|
41
41
|
try_count = ndb.IntegerProperty(required=False)
|
|
42
42
|
demo_account = ndb.BooleanProperty(required=False, default=False)
|
|
43
43
|
deleted = ndb.BooleanProperty(required=False, default=False)
|
|
44
|
+
signin_device_session = ndb.JsonProperty()
|
|
44
45
|
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
dict_properties = ['user_id', 'name', 'email', 'gravatar_url', 'active', 'locked', 'lock_expiry_datetime']
|
|
47
|
+
dict_properties = ['user_id', 'name', 'email', 'signin_device_session', 'gravatar_url', 'active', 'locked', 'lock_expiry_datetime']
|
|
48
48
|
|
|
49
49
|
@classmethod
|
|
50
50
|
#@cache.memoize(timeout=60)
|
|
@@ -63,6 +63,18 @@ class UserMin(BaseNModel, DictModel, UserMixin):
|
|
|
63
63
|
def is_admin_user(self):
|
|
64
64
|
return False
|
|
65
65
|
|
|
66
|
+
@property
|
|
67
|
+
def signin_device_id(self):
|
|
68
|
+
if is_not_empty(self.signin_device_session):
|
|
69
|
+
return self.signin_device_session.get('device_id')
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def signin_expiry_datetime(self):
|
|
73
|
+
if is_not_empty(self.signin_device_session):
|
|
74
|
+
expiry_datetime_str = self.signin_device_session.get('expiry_datetime')
|
|
75
|
+
if is_not_empty(expiry_datetime_str):
|
|
76
|
+
return datetime.strptime(expiry_datetime_str, '%d-%m-%Y %H:%M:%S')
|
|
77
|
+
|
|
66
78
|
def is_valid_password(self, checking_password):
|
|
67
79
|
hashed_signin_password = hash_password(self.user_id, checking_password)
|
|
68
80
|
|
|
@@ -266,11 +278,11 @@ class UserBase(UserMin):
|
|
|
266
278
|
|
|
267
279
|
if is_email_verified==False:
|
|
268
280
|
created_user.email_vc = random_number(6)
|
|
269
|
-
created_user.email_vc_expiry_datetime = datetime.
|
|
281
|
+
created_user.email_vc_expiry_datetime = datetime.utcnow()() + timedelta(minutes=10)
|
|
270
282
|
|
|
271
283
|
if is_mobile_phone_verified==False:
|
|
272
284
|
created_user.mobile_phone_vc = random_number(6)
|
|
273
|
-
created_user.mobile_phone_vc_expiry_datetime = datetime.
|
|
285
|
+
created_user.mobile_phone_vc_expiry_datetime = datetime.utcnow() + timedelta(minutes=10)
|
|
274
286
|
|
|
275
287
|
created_user.put()
|
|
276
288
|
|
|
@@ -379,7 +391,8 @@ class User(UserBase):
|
|
|
379
391
|
'mobile_phone', 'email', 'password', 'name', 'birth_date', 'gender',
|
|
380
392
|
'reference_code', 'country', 'state', 'city', 'postcode',
|
|
381
393
|
'address', 'redeem_pin', 'new_message_count', 'status',
|
|
382
|
-
'device_details',
|
|
394
|
+
'device_details', 'signin_device_session', 'referral_code',
|
|
395
|
+
'last_login_datetime',
|
|
383
396
|
]
|
|
384
397
|
|
|
385
398
|
#unique_attributes = 'email,username'
|
|
@@ -387,7 +400,7 @@ class User(UserBase):
|
|
|
387
400
|
audit_properties = [
|
|
388
401
|
'mobile_phone', 'email', 'password', 'name', 'birth_date', 'gender',
|
|
389
402
|
'reference_code', 'country', 'state', 'city', 'postcode',
|
|
390
|
-
'address', 'redeem_pin', 'status', 'device_details',
|
|
403
|
+
'address', 'redeem_pin', 'status', 'device_details',
|
|
391
404
|
|
|
392
405
|
]
|
|
393
406
|
|
|
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
|
{trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/redemption_catalogue_models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex-model-1.4.4 → trex-model-1.4.5}/trexmodel/models/datastore/spending_base_program_model.py
RENAMED
|
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
|