trex-model 1.5.6__tar.gz → 1.5.7__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.5.6 → trex-model-1.5.7}/PKG-INFO +1 -1
- {trex-model-1.5.6 → trex-model-1.5.7}/setup.py +1 -1
- {trex-model-1.5.6 → trex-model-1.5.7}/trex_model.egg-info/PKG-INFO +1 -1
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/loyalty_models.py +53 -29
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/merchant_helpers.py +6 -3
- {trex-model-1.5.6 → trex-model-1.5.7}/LICENSE +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/MANIFEST.in +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/README.md +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/setup.cfg +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trex_model.egg-info/SOURCES.txt +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trex_model.egg-info/dependency_links.txt +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trex_model.egg-info/requires.txt +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trex_model.egg-info/top_level.txt +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/conf.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/admin_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/analytic_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/app_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/coporate_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/customer_model_helpers.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/customer_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/import_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/inventory_model.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/marketing_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/membership_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/merchant_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/message_model_helper.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/message_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/model_decorators.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/ndb_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/pos_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/prepaid_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/product_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/program_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/rating_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/recruit_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/redeem_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/referral_program_model.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/reward_model_helpers.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/reward_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/system_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/task_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/test_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/transaction_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/user_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/voucher_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/model_decorator.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/models/prepaid_helpers.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/pos_conf.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/program_conf.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/utils/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/utils/gcloud/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/utils/gcloud/datastore_util.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/utils/model/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.7}/trexmodel/utils/model/model_util.py +0 -0
|
@@ -20,18 +20,23 @@ class LoyaltyDeviceSetting(BaseNModel,DictModel):
|
|
|
20
20
|
'''
|
|
21
21
|
merchant_acct as ancestor
|
|
22
22
|
'''
|
|
23
|
-
device_name
|
|
24
|
-
activation_code
|
|
25
|
-
device_id
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
device_name = ndb.StringProperty(required=True)
|
|
24
|
+
activation_code = ndb.StringProperty(required=True)
|
|
25
|
+
device_id = ndb.StringProperty(required=False)
|
|
26
|
+
enable_lock_screen = ndb.BooleanProperty(required=True, default=False)
|
|
27
|
+
lock_screen_code = ndb.StringProperty(required=False, default='')
|
|
28
|
+
lock_screen_length_in_second = ndb.IntegerProperty(required=False, default=30)
|
|
29
|
+
activated = ndb.BooleanProperty(required=True, default=False)
|
|
30
|
+
assigned_outlet = ndb.KeyProperty(name="assigned_outlet", kind=Outlet)
|
|
31
|
+
created_datetime = ndb.DateTimeProperty(required=True, auto_now_add=True)
|
|
32
|
+
activated_datetime = ndb.DateTimeProperty(required=False)
|
|
33
|
+
testing = ndb.BooleanProperty(required=False, default=False)
|
|
34
|
+
device_details = ndb.JsonProperty()
|
|
32
35
|
|
|
33
36
|
dict_properties = ['device_name', 'activation_code', 'device_id', 'activated', 'assigned_outlet_key',
|
|
34
|
-
'activated_datetime', 'created_datetime', 'device_details'
|
|
37
|
+
'activated_datetime', 'created_datetime', 'device_details',
|
|
38
|
+
'enable_lock_screen', 'lock_screen_code', 'lock_screen_length_in_second'
|
|
39
|
+
]
|
|
35
40
|
|
|
36
41
|
@property
|
|
37
42
|
def device_tokens_list(self):
|
|
@@ -61,7 +66,11 @@ class LoyaltyDeviceSetting(BaseNModel,DictModel):
|
|
|
61
66
|
return self.assigned_outlet_entity.merchant_acct_entity
|
|
62
67
|
|
|
63
68
|
@staticmethod
|
|
64
|
-
def create(device_name, merchant_acct, assign_outlet
|
|
69
|
+
def create(device_name, merchant_acct, assign_outlet,
|
|
70
|
+
enable_lock_screen,
|
|
71
|
+
lock_screen_code,
|
|
72
|
+
lock_screen_length_in_second,
|
|
73
|
+
):
|
|
65
74
|
activation_code = random_number(16)
|
|
66
75
|
checking_activation_device_setting = LoyaltyDeviceSetting.get_by_activation_code(activation_code)
|
|
67
76
|
regenerate_activation_code = False
|
|
@@ -77,10 +86,13 @@ class LoyaltyDeviceSetting(BaseNModel,DictModel):
|
|
|
77
86
|
|
|
78
87
|
|
|
79
88
|
device_setting = LoyaltyDeviceSetting(
|
|
80
|
-
parent
|
|
81
|
-
device_name
|
|
82
|
-
activation_code
|
|
83
|
-
assigned_outlet
|
|
89
|
+
parent = merchant_acct.create_ndb_key(),
|
|
90
|
+
device_name = device_name,
|
|
91
|
+
activation_code = activation_code,
|
|
92
|
+
assigned_outlet = assign_outlet.create_ndb_key(),
|
|
93
|
+
enable_lock_screen = enable_lock_screen,
|
|
94
|
+
lock_screen_code = lock_screen_code,
|
|
95
|
+
lock_screen_length_in_second = lock_screen_length_in_second,
|
|
84
96
|
|
|
85
97
|
)
|
|
86
98
|
|
|
@@ -88,10 +100,17 @@ class LoyaltyDeviceSetting(BaseNModel,DictModel):
|
|
|
88
100
|
return device_setting
|
|
89
101
|
|
|
90
102
|
@staticmethod
|
|
91
|
-
def update(pos_setting_key, device_name, assigned_outlet
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
def update(pos_setting_key, device_name, assigned_outlet,
|
|
104
|
+
enable_lock_screen,
|
|
105
|
+
lock_screen_code,
|
|
106
|
+
lock_screen_length_in_second,
|
|
107
|
+
):
|
|
108
|
+
checking_device_setting = LoyaltyDeviceSetting.fetch(pos_setting_key)
|
|
109
|
+
checking_device_setting.device_name = device_name
|
|
110
|
+
checking_device_setting.assigned_outlet = assigned_outlet.create_ndb_key()
|
|
111
|
+
checking_device_setting.enable_lock_screen = enable_lock_screen
|
|
112
|
+
checking_device_setting.lock_screen_code = lock_screen_code
|
|
113
|
+
checking_device_setting.lock_screen_length_in_second = lock_screen_length_in_second
|
|
95
114
|
checking_device_setting.put()
|
|
96
115
|
|
|
97
116
|
return checking_device_setting
|
|
@@ -152,7 +171,15 @@ class LoyaltyDeviceSetting(BaseNModel,DictModel):
|
|
|
152
171
|
if self.device_details:
|
|
153
172
|
found_device_details_list_by_platform = self.device_details.get(platform)
|
|
154
173
|
if found_device_details_list_by_platform:
|
|
174
|
+
self.device_details[platform] = {
|
|
175
|
+
'device_token' : device_token,
|
|
176
|
+
'last_updated_datetime' : datetime.utcnow().strftime("%d-%m-%Y %H:%M:%S"),
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
'''
|
|
155
181
|
is_found = False
|
|
182
|
+
|
|
156
183
|
for device_details_by_platform in found_device_details_list_by_platform:
|
|
157
184
|
device_token_by_platform = device_details_by_platform.get('device_token')
|
|
158
185
|
if device_token_by_platform:
|
|
@@ -168,21 +195,18 @@ class LoyaltyDeviceSetting(BaseNModel,DictModel):
|
|
|
168
195
|
}
|
|
169
196
|
)
|
|
170
197
|
|
|
171
|
-
|
|
198
|
+
'''
|
|
172
199
|
else:
|
|
173
|
-
self.device_details[platform] =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
]
|
|
200
|
+
self.device_details[platform] = {
|
|
201
|
+
'device_token' : device_token,
|
|
202
|
+
'last_updated_datetime' : datetime.utcnow().strftime("%d-%m-%Y %H:%M:%S"),
|
|
203
|
+
}
|
|
179
204
|
else:
|
|
180
205
|
self.device_details = {
|
|
181
|
-
platform :
|
|
182
|
-
{
|
|
206
|
+
platform : {
|
|
183
207
|
'device_token' : device_token,
|
|
184
208
|
'last_updated_datetime' : datetime.utcnow().strftime("%d-%m-%Y %H:%M:%S"),
|
|
185
209
|
}
|
|
186
|
-
|
|
210
|
+
|
|
187
211
|
}
|
|
188
212
|
self.put()
|
|
@@ -247,8 +247,11 @@ def construct_setting_by_outlet(outlet, device_setting=None):
|
|
|
247
247
|
'membership_configurations' : merchant_acct.membership_configuration,
|
|
248
248
|
}
|
|
249
249
|
if device_setting:
|
|
250
|
-
setting['activation_code']
|
|
251
|
-
setting['device_name']
|
|
252
|
-
setting['device_id']
|
|
250
|
+
setting['activation_code'] = device_setting.activation_code
|
|
251
|
+
setting['device_name'] = device_setting.device_name
|
|
252
|
+
setting['device_id'] = device_setting.device_id
|
|
253
|
+
setting['enable_lock_screen'] = device_setting.enable_lock_screen
|
|
254
|
+
setting['lock_screen_code'] = device_setting.lock_screen_code
|
|
255
|
+
setting['lock_screen_length_in_second'] = device_setting.lock_screen_length_in_second
|
|
253
256
|
|
|
254
257
|
return setting
|
|
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.5.6 → trex-model-1.5.7}/trexmodel/models/datastore/redemption_catalogue_models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex-model-1.5.6 → trex-model-1.5.7}/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
|