trex-model 1.5.6__tar.gz → 1.5.8__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.8}/PKG-INFO +1 -1
- {trex-model-1.5.6 → trex-model-1.5.8}/setup.py +1 -1
- {trex-model-1.5.6 → trex-model-1.5.8}/trex_model.egg-info/PKG-INFO +1 -1
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/loyalty_models.py +53 -29
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/merchant_helpers.py +26 -22
- {trex-model-1.5.6 → trex-model-1.5.8}/LICENSE +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/MANIFEST.in +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/README.md +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/setup.cfg +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trex_model.egg-info/SOURCES.txt +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trex_model.egg-info/dependency_links.txt +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trex_model.egg-info/requires.txt +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trex_model.egg-info/top_level.txt +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/conf.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/admin_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/analytic_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/app_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/coporate_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/customer_model_helpers.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/customer_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/import_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/inventory_model.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/marketing_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/membership_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/merchant_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/message_model_helper.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/message_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/model_decorators.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/ndb_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/pos_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/prepaid_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/product_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/program_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/rating_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/recruit_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/redeem_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/referral_program_model.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/reward_model_helpers.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/reward_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/system_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/task_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/test_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/transaction_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/user_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/datastore/voucher_models.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/model_decorator.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/models/prepaid_helpers.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/pos_conf.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/program_conf.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/utils/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/utils/gcloud/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/utils/gcloud/datastore_util.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/trexmodel/utils/model/__init__.py +0 -0
- {trex-model-1.5.6 → trex-model-1.5.8}/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()
|
|
@@ -141,7 +141,7 @@ def construct_outlet_info(outlet):
|
|
|
141
141
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
def construct_setting_by_outlet(outlet, device_setting=None):
|
|
144
|
+
def construct_setting_by_outlet(outlet, device_setting=None, is_pos_device=False):
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
merchant_acct = outlet.merchant_acct_entity
|
|
@@ -156,25 +156,26 @@ def construct_setting_by_outlet(outlet, device_setting=None):
|
|
|
156
156
|
'currency' : merchant_acct.currency_code,
|
|
157
157
|
'locale' : merchant_acct.locale,
|
|
158
158
|
}
|
|
159
|
+
if is_pos_device:
|
|
160
|
+
if dinning_option_list:
|
|
161
|
+
for d in dinning_option_list:
|
|
162
|
+
dinning_option_json.append({
|
|
163
|
+
'option_key' : d.key_in_str,
|
|
164
|
+
'option_name' : d.name,
|
|
165
|
+
'option_prefix' : d.prefix,
|
|
166
|
+
'is_default' : d.is_default,
|
|
167
|
+
'is_dinning_input' : d.is_dinning_input,
|
|
168
|
+
'is_delivery_input' : d.is_delivery_input,
|
|
169
|
+
'is_takeaway_input' : d.is_takeaway_input,
|
|
170
|
+
'is_self_order_input' : d.is_self_order_input,
|
|
171
|
+
'is_self_payment_mandatory' : d.is_self_payment_mandatory,
|
|
172
|
+
'dinning_table_is_required' : d.dinning_table_is_required,
|
|
173
|
+
'assign_queue' : d.assign_queue,
|
|
174
|
+
})
|
|
159
175
|
|
|
160
|
-
if
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
'option_key' : d.key_in_str,
|
|
164
|
-
'option_name' : d.name,
|
|
165
|
-
'option_prefix' : d.prefix,
|
|
166
|
-
'is_default' : d.is_default,
|
|
167
|
-
'is_dinning_input' : d.is_dinning_input,
|
|
168
|
-
'is_delivery_input' : d.is_delivery_input,
|
|
169
|
-
'is_takeaway_input' : d.is_takeaway_input,
|
|
170
|
-
'is_self_order_input' : d.is_self_order_input,
|
|
171
|
-
'is_self_payment_mandatory' : d.is_self_payment_mandatory,
|
|
172
|
-
'dinning_table_is_required' : d.dinning_table_is_required,
|
|
173
|
-
'assign_queue' : d.assign_queue,
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
account_settings['dinning_option_list'] = dinning_option_json
|
|
176
|
+
if is_pos_device:
|
|
177
|
+
account_settings['dinning_option_list'] = dinning_option_json
|
|
178
|
+
|
|
178
179
|
if invoice_no_generation:
|
|
179
180
|
account_settings['invoice_settings'] = {
|
|
180
181
|
'invoice_no_generators' : invoice_no_generation.generators_list,
|
|
@@ -247,8 +248,11 @@ def construct_setting_by_outlet(outlet, device_setting=None):
|
|
|
247
248
|
'membership_configurations' : merchant_acct.membership_configuration,
|
|
248
249
|
}
|
|
249
250
|
if device_setting:
|
|
250
|
-
setting['activation_code']
|
|
251
|
-
setting['device_name']
|
|
252
|
-
setting['device_id']
|
|
251
|
+
setting['activation_code'] = device_setting.activation_code
|
|
252
|
+
setting['device_name'] = device_setting.device_name
|
|
253
|
+
setting['device_id'] = device_setting.device_id
|
|
254
|
+
setting['enable_lock_screen'] = device_setting.enable_lock_screen
|
|
255
|
+
setting['lock_screen_code'] = device_setting.lock_screen_code
|
|
256
|
+
setting['lock_screen_length_in_second'] = device_setting.lock_screen_length_in_second
|
|
253
257
|
|
|
254
258
|
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.8}/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.8}/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
|