trex-model 1.3.4__tar.gz → 1.3.6__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.

Files changed (59) hide show
  1. {trex-model-1.3.4/trex_model.egg-info → trex-model-1.3.6}/PKG-INFO +1 -1
  2. {trex-model-1.3.4 → trex-model-1.3.6}/setup.py +1 -1
  3. {trex-model-1.3.4 → trex-model-1.3.6/trex_model.egg-info}/PKG-INFO +1 -1
  4. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/customer_model_helpers.py +7 -2
  5. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/customer_models.py +2 -0
  6. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/marketing_models.py +35 -9
  7. {trex-model-1.3.4 → trex-model-1.3.6}/LICENSE +0 -0
  8. {trex-model-1.3.4 → trex-model-1.3.6}/MANIFEST.in +0 -0
  9. {trex-model-1.3.4 → trex-model-1.3.6}/README.md +0 -0
  10. {trex-model-1.3.4 → trex-model-1.3.6}/setup.cfg +0 -0
  11. {trex-model-1.3.4 → trex-model-1.3.6}/trex_model.egg-info/SOURCES.txt +0 -0
  12. {trex-model-1.3.4 → trex-model-1.3.6}/trex_model.egg-info/dependency_links.txt +0 -0
  13. {trex-model-1.3.4 → trex-model-1.3.6}/trex_model.egg-info/requires.txt +0 -0
  14. {trex-model-1.3.4 → trex-model-1.3.6}/trex_model.egg-info/top_level.txt +0 -0
  15. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/__init__.py +0 -0
  16. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/conf.py +0 -0
  17. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/__init__.py +0 -0
  18. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/__init__.py +0 -0
  19. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/admin_models.py +0 -0
  20. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/analytic_models.py +0 -0
  21. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/app_models.py +0 -0
  22. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/coporate_models.py +0 -0
  23. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
  24. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/import_models.py +0 -0
  25. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/inventory_model.py +0 -0
  26. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/loyalty_models.py +0 -0
  27. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
  28. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/membership_models.py +0 -0
  29. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/merchant_models.py +0 -0
  30. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/message_model_helper.py +0 -0
  31. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/message_models.py +0 -0
  32. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/model_decorators.py +0 -0
  33. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/ndb_models.py +0 -0
  34. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/pos_models.py +0 -0
  35. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/prepaid_models.py +0 -0
  36. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/product_models.py +0 -0
  37. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/program_models.py +0 -0
  38. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/rating_models.py +0 -0
  39. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/redeem_models.py +0 -0
  40. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
  41. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/reward_model_helpers.py +0 -0
  42. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/reward_models.py +0 -0
  43. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
  44. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/system_models.py +0 -0
  45. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/task_models.py +0 -0
  46. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/test_models.py +0 -0
  47. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/transaction_models.py +0 -0
  48. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/user_models.py +0 -0
  49. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/datastore/voucher_models.py +0 -0
  50. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/merchant_helpers.py +0 -0
  51. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/model_decorator.py +0 -0
  52. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/models/prepaid_helpers.py +0 -0
  53. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/pos_conf.py +0 -0
  54. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/program_conf.py +0 -0
  55. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/utils/__init__.py +0 -0
  56. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/utils/gcloud/__init__.py +0 -0
  57. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/utils/gcloud/datastore_util.py +0 -0
  58. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/utils/model/__init__.py +0 -0
  59. {trex-model-1.3.4 → trex-model-1.3.6}/trexmodel/utils/model/model_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trex-model
3
- Version: 1.3.4
3
+ Version: 1.3.6
4
4
  Summary: TRex database module package
5
5
  Home-page: https://bitbucket.org/lokjac/trex-model
6
6
  Author: Jack Lok
@@ -3,7 +3,7 @@ with open("README.md", "r") as fh:
3
3
  long_description = fh.read()
4
4
  setuptools.setup(
5
5
  name='trex-model',
6
- version='1.3.4',
6
+ version='1.3.6',
7
7
  author="Jack Lok",
8
8
  author_email="sglok77@gmail.com",
9
9
  description="TRex database module package",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trex-model
3
- Version: 1.3.4
3
+ Version: 1.3.6
4
4
  Summary: TRex database module package
5
5
  Home-page: https://bitbucket.org/lokjac/trex-model
6
6
  Author: Jack Lok
@@ -186,14 +186,19 @@ def update_customer_entiteld_voucher_summary_with_new_voucher_info(customer_enti
186
186
  voucher_summary = customer_entitled_voucher_summary.get(merchant_voucher_key)
187
187
  latest_expiry_date_str = None
188
188
  if redeem_info_list and len(redeem_info_list)>0:
189
- latest_expiry_date = get_latest_expiry_date(redeem_info_list)
190
- latest_expiry_date_str = datetime.strftime(latest_expiry_date, '%d-%m-%Y')
189
+
190
+ latest_expiry_date = get_latest_expiry_date(redeem_info_list)
191
+ latest_expiry_date_str = datetime.strftime(latest_expiry_date, '%d-%m-%Y')
192
+
193
+ logger.debug('New entitled voucher latest_expiry_date_str=%s', latest_expiry_date_str)
191
194
 
192
195
  if voucher_summary:
196
+ logger.debug('Found voucher summary, thus going to add new redeem info')
193
197
  customer_entitled_voucher_summary[merchant_voucher_key]['redeem_info_list'].extend(redeem_info_list)
194
198
  customer_entitled_voucher_summary[merchant_voucher_key]['amount'] = len(customer_entitled_voucher_summary[merchant_voucher_key]['redeem_info_list'])
195
199
 
196
200
  else:
201
+ logger.debug('Not found voucher summary, thus going to create it')
197
202
  voucher_summary = {
198
203
  'key' : merchant_voucher_key,
199
204
  'label' : voucher_label,
@@ -242,7 +242,9 @@ class Customer(BaseNModel, DictModel, FullTextSearchable):
242
242
 
243
243
  @staticmethod
244
244
  def remove_ticket_from_lucky_draw_ticket_summary(customer_acct, removed_draw_ticket):
245
+ logger.debug('removed_draw_ticket=%s', removed_draw_ticket)
245
246
  entitled_lucky_draw_ticket_summary = {}
247
+
246
248
  if customer_acct.entitled_lucky_draw_ticket_summary:
247
249
  entitled_lucky_draw_ticket_summary = customer_acct.entitled_lucky_draw_ticket_summary
248
250
 
@@ -138,25 +138,41 @@ class PushNotificationSetup(BaseNModel, DictModel):
138
138
  return PushNotificationSetup.query(ndb.AND(PushNotificationSetup.is_archived==True), ancestor=merchant_acct.create_ndb_key()).fetch(limit=model_conf.MAX_FETCH_RECORD)
139
139
 
140
140
  @staticmethod
141
- def list(start_datetime=datetime.utcnow(), end_datetime=datetime.utcnow()):
142
- result = PushNotificationSetup.query(
141
+ def list(start_datetime=datetime.utcnow(), end_datetime=datetime.utcnow(), send=False):
142
+ if send==False:
143
+ result = PushNotificationSetup.query(
143
144
  ndb.AND(
144
145
  PushNotificationSetup.send==False,
145
146
  PushNotificationSetup.schedule_datetime>start_datetime,
146
147
  PushNotificationSetup.schedule_datetime<=end_datetime,
147
148
  )
148
149
  ).fetch(offset=0, limit=conf.MAX_FETCH_RECORD)
150
+ else:
151
+ result = PushNotificationSetup.query(
152
+ ndb.AND(
153
+ PushNotificationSetup.schedule_datetime>start_datetime,
154
+ PushNotificationSetup.schedule_datetime<=end_datetime,
155
+ )
156
+ ).fetch(offset=0, limit=conf.MAX_FETCH_RECORD)
149
157
  return result
150
158
 
151
159
  @staticmethod
152
- def cound(start_datetime=datetime.utcnow(), end_datetime=datetime.utcnow()):
153
- result = PushNotificationSetup.query(
160
+ def cound(start_datetime=datetime.utcnow(), end_datetime=datetime.utcnow(), send=False):
161
+ if send==False:
162
+ result = PushNotificationSetup.query(
154
163
  ndb.AND(
155
164
  PushNotificationSetup.send==False,
156
165
  PushNotificationSetup.schedule_datetime>start_datetime,
157
166
  PushNotificationSetup.schedule_datetime<=end_datetime,
158
167
  )
159
168
  ).fetch(offset=0, limit=conf.MAX_FETCH_RECORD)
169
+ else:
170
+ result = PushNotificationSetup.query(
171
+ ndb.AND(
172
+ PushNotificationSetup.schedule_datetime>start_datetime,
173
+ PushNotificationSetup.schedule_datetime<=end_datetime,
174
+ )
175
+ ).fetch(offset=0, limit=conf.MAX_FETCH_RECORD)
160
176
  return result
161
177
 
162
178
  class MarketingImage(BaseNModel, DictModel):
@@ -231,18 +247,28 @@ class ScheduledPushNotificationHistory(BaseNModel, DictModel):
231
247
 
232
248
 
233
249
  @staticmethod
234
- def list(scheduled_datetime=datetime.utcnow()):
235
- result = ScheduledPushNotificationHistory.query(
250
+ def list(scheduled_datetime=datetime.utcnow(), send=False):
251
+ if send==False:
252
+ result = ScheduledPushNotificationHistory.query(
236
253
  ndb.AND(
237
254
  ScheduledPushNotificationHistory.send==False,
238
255
  ScheduledPushNotificationHistory.scheduled_datetime<=scheduled_datetime)).fetch(offset=0, limit=conf.MAX_FETCH_RECORD)
256
+ else:
257
+ result = ScheduledPushNotificationHistory.query(
258
+ ndb.AND(
259
+ ScheduledPushNotificationHistory.scheduled_datetime<=scheduled_datetime)).fetch(offset=0, limit=conf.MAX_FETCH_RECORD)
239
260
  return result
240
261
 
241
262
  @staticmethod
242
- def count(scheduled_datetime=datetime.utcnow()):
243
- return ScheduledPushNotificationHistory.query(
263
+ def count(scheduled_datetime=datetime.utcnow(), send=False):
264
+ if send==False:
265
+ return ScheduledPushNotificationHistory.query(
244
266
  ndb.AND(
245
267
  ScheduledPushNotificationHistory.send==False,
246
268
  ScheduledPushNotificationHistory.scheduled_datetime<=scheduled_datetime)).count(limit=conf.MAX_FETCH_RECORD)
247
-
269
+ else:
270
+ return ScheduledPushNotificationHistory.query(
271
+ ndb.AND(
272
+ ScheduledPushNotificationHistory.scheduled_datetime<=scheduled_datetime)).count(limit=conf.MAX_FETCH_RECORD)
273
+
248
274
 
File without changes
File without changes
File without changes
File without changes
File without changes