django-restit 4.2.135__py3-none-any.whl → 4.2.136__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.
account/models/group.py CHANGED
@@ -134,6 +134,7 @@ class Group(models.Model, RestModel, MetaDataModel):
134
134
 
135
135
  _tz_long = None
136
136
  _tz_short = None
137
+ _eod_hour = None
137
138
 
138
139
  @property
139
140
  def timezone(self):
@@ -147,6 +148,12 @@ class Group(models.Model, RestModel, MetaDataModel):
147
148
  self._tz_short = rh.getShortTZ(self.timezone)
148
149
  return self._tz_short
149
150
 
151
+ @property
152
+ def end_of_day_hour(self):
153
+ if self._eod_hour is None:
154
+ self._eod_hour = self.getParentProperty("eod", 0, field_type=int)
155
+ return self._eod_hour
156
+
150
157
  @property
151
158
  def file_safe_name(self):
152
159
  return re.sub("[^0-9a-zA-Z]+", "_", self.name.lower())
@@ -361,34 +368,27 @@ class Group(models.Model, RestModel, MetaDataModel):
361
368
  return default
362
369
 
363
370
  def getLocalTime(self, when=None, tz_aware=False):
364
- zone = self.getParentProperty("timezone", "America/Los_Angeles")
365
- return rh.convertToLocalTime(zone, when, tz_aware)
371
+ return rh.convertToLocalTime(self.timezone, when, tz_aware)
366
372
 
367
373
  def getUTC(self, when):
368
- zone = self.getParentProperty("timezone", "America/Los_Angeles")
369
- return rh.convertToUTC(zone, when)
374
+ return rh.convertToUTC(self.timezone, when)
370
375
 
371
376
  def getBusinessDay(self, start=None, end=None, kind="day"):
372
- zone = self.getParentProperty("timezone", "America/Los_Angeles")
373
- eod = self.getParentProperty("eod", 0, field_type=int)
374
- return rh.getDateRange(start, end, kind, zone, hour=eod)
377
+ return rh.getDateRange(start, end, kind, self.timezone, hour=self.end_of_day_hour)
375
378
 
376
379
  def getOperatingHours(self, start=None, end=None, kind="day"):
377
380
  # deprecate this, operating hours is deceptive
378
- zone = self.getParentProperty("timezone", "America/Los_Angeles")
379
- eod = self.getParentProperty("eod", 0, field_type=int)
380
- return rh.getDateRange(start, end, kind, zone, hour=eod)
381
+ return rh.getDateRange(start, end, kind, self.timezone, hour=self.end_of_day_hour)
381
382
 
382
383
  def getTimeZoneOffset(self, when=None, hour=None):
383
- zone = self.getParentProperty("timezone", "America/Los_Angeles")
384
- return rh.getTimeZoneOffset(zone, when, hour=hour)
384
+ return rh.getTimeZoneOffset(self.timezone, when, hour=hour)
385
385
 
386
386
  def getEOD(self, eod=None, onday=None, in_local=False):
387
387
  if eod is None:
388
- eod = self.getParentProperty("eod", 0, field_type=int)
388
+ eod = self.end_of_day_hour
389
389
  if in_local:
390
390
  return eod
391
- offset = self.getTimeZoneOffset(onday, hour=eod)
391
+ offset = self.getTimeZoneOffset(onday, hour=self.end_of_day_hour)
392
392
  return offset
393
393
 
394
394
  def updateUUID(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-restit
3
- Version: 4.2.135
3
+ Version: 4.2.136
4
4
  Summary: A Rest Framework for DJANGO
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -28,7 +28,7 @@ account/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
28
28
  account/models/__init__.py,sha256=cV_lMnT2vL_mjiYtT4hlcIHo52ocFbGSNVkOIHHLXZY,385
29
29
  account/models/device.py,sha256=0AFeLMGk4im4KZVd3eGSyRbK4eQEXiFM2cdY8GUzihs,5934
30
30
  account/models/feeds.py,sha256=vI7fG4ASY1M0Zjke24RdnfDcuWeATl_yR_25jPmT64g,2011
31
- account/models/group.py,sha256=gsCze5dxTBcDayNalujAA-v8gKx3vC2cQwuUH6Jg9Tg,23100
31
+ account/models/group.py,sha256=N9Ow7AtV4xN5zSE9E5-msthJy0G5-3DEr2MTmvFO1kU,22887
32
32
  account/models/legacy.py,sha256=zYdtv4LC0ooxPVqWM-uToPwV-lYWQLorSE6p6yn1xDw,2720
33
33
  account/models/member.py,sha256=FvVUoc_n7PgqxXduQRF-S4VJcl8aER5tMBxM5xsgswU,54682
34
34
  account/models/membership.py,sha256=90EpAhOsGaqphDAkONP6j_qQ0OWSRaQsI8H7E7fgMkE,9249
@@ -377,7 +377,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
377
377
  rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
378
378
  rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
379
379
  rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
380
- rest/__init__.py,sha256=jvMDmcVTsAQ0iA0xPSbOztX_yr1rfxCPVRM4H93ysos,122
380
+ rest/__init__.py,sha256=P7AsJG2-fQOZPMovCvkbEW57dyHqLdU0F4_ptZlHISg,122
381
381
  rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
382
382
  rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
383
383
  rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
@@ -513,7 +513,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
513
513
  ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
514
514
  ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
515
515
  ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
516
- django_restit-4.2.135.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
517
- django_restit-4.2.135.dist-info/METADATA,sha256=y5BF4iNU-96HCWsE7bLYHz9-lOK6htULuY729Hs6NwI,7663
518
- django_restit-4.2.135.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
519
- django_restit-4.2.135.dist-info/RECORD,,
516
+ django_restit-4.2.136.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
517
+ django_restit-4.2.136.dist-info/METADATA,sha256=0XTqwV9RSBBDL7jfrwHLJoRI-Rr122bpMowDHQbuLCA,7663
518
+ django_restit-4.2.136.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
519
+ django_restit-4.2.136.dist-info/RECORD,,
rest/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from .uberdict import UberDict # noqa: F401
2
2
  from .settings_helper import settings # noqa: F401
3
3
 
4
- __version__ = "4.2.135"
4
+ __version__ = "4.2.136"