django-restit 4.2.117__py3-none-any.whl → 4.2.119__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: django-restit
3
- Version: 4.2.117
3
+ Version: 4.2.119
4
4
  Summary: A Rest Framework for DJANGO
5
5
  License: MIT
6
6
  Author: Ian Starnes
@@ -351,7 +351,7 @@ metrics/migrations/0003_metrics_expires.py,sha256=_g4oRv4NHW-4iCQx2s1SiF38LLyFf8
351
351
  metrics/migrations/0004_eodmetrics.py,sha256=Ky6ZVMZqa0F_SUp_QFWY7ZKBgVhy9CS4wZcsEhrkSgc,3271
352
352
  metrics/migrations/0005_alter_metrics_v1_alter_metrics_v10_alter_metrics_v11_and_more.py,sha256=pmwJfpPJ1RUX_CqM66l6vvV-nrAUPo_GIan0Pc9mQHs,2358
353
353
  metrics/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
354
- metrics/models.py,sha256=lD9nVzfwdav70ENulqJ8rE8Ui8EWlzdVp05rg8bAlMA,13444
354
+ metrics/models.py,sha256=SF3fCAK43GIDh1_wkkoSc5cv1zKBDo4gv0mP5lFxPwc,13564
355
355
  metrics/periodic.py,sha256=IayBLLat40D8FB-A3bYBW9lxm9-IzcugQunojThQ_OU,661
356
356
  metrics/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
357
357
  metrics/providers/aws.py,sha256=dIBGFE1Fvszy6rmVrn_Fm1zUDv345q4dBsg9Iit-XCc,8358
@@ -374,7 +374,7 @@ pushit/utils.py,sha256=IeTCGa-164nmB1jIsK1lu1O1QzUhS3BKfuXHGjCW-ck,2121
374
374
  rest/.gitignore,sha256=TbEvWRMnAiajCTOdhiNrd9eeCAaIjRp9PRjE_VkMM5g,118
375
375
  rest/README.md,sha256=V3ETc-cJu8PZIbKr9xSe_pA4JEUpC8Dhw4bQeVCDJPw,5460
376
376
  rest/RemoteEvents.py,sha256=nL46U7AuxIrlw2JunphR1tsXyqi-ep_gD9CYGpYbNgE,72
377
- rest/__init__.py,sha256=eEcQu-xBJYFfnIKJ2D20u1uTGYqA98jafXZ8kYWSowY,122
377
+ rest/__init__.py,sha256=T69hPGVuXYLkkZwzO8U8g_fb7Vw1XimtawbmkqkYBio,122
378
378
  rest/arc4.py,sha256=y644IbF1ec--e4cUJ3KEYsewTCITK0gmlwa5mJruFC0,1967
379
379
  rest/cache.py,sha256=1Qg0rkaCJCaVP0-l5hZg2CIblTdeBSlj_0fP6vlKUpU,83
380
380
  rest/crypto/__init__.py,sha256=Tl0U11rgj1eBYqd6OXJ2_XSdNLumW_JkBZnaJqI6Ldw,72
@@ -509,7 +509,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
509
509
  ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
510
510
  ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
511
511
  ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
512
- django_restit-4.2.117.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
513
- django_restit-4.2.117.dist-info/METADATA,sha256=JwiKaeVRnqgf3Vmbq6pENaofQTVTldb95V4T0dRh6_c,7663
514
- django_restit-4.2.117.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
515
- django_restit-4.2.117.dist-info/RECORD,,
512
+ django_restit-4.2.119.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
513
+ django_restit-4.2.119.dist-info/METADATA,sha256=bfo5mQTv9HTNskCFG0XkAhrkfzGHplgxitT1tKK9Ul4,7663
514
+ django_restit-4.2.119.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
515
+ django_restit-4.2.119.dist-info/RECORD,,
metrics/models.py CHANGED
@@ -46,17 +46,19 @@ def metric(
46
46
  m.updateMetrics(keys, data, created)
47
47
 
48
48
 
49
- def gauge(slug, keys, data, granularity="daily", group=None, date=None, timezone=None, slug_append=None):
49
+ def gauge(slug, keys, data, granularity="daily", group=None, date=None,
50
+ timezone=None, slug_append=None, max_granularity=None):
50
51
  # guage does not accumulate but just stores the data like a cache
51
52
  # if calledf on the same time period it will just update the current numbers
53
+ if max_granularity is None:
54
+ max_granularity = granularity
52
55
  uuid_key = generate_uuid(slug, group, slug_append)
53
- granularities = utils.granularities(granularity, granularity)
56
+ granularities = utils.granularities(granularity, max_granularity)
54
57
  date = normalize_date(date, timezone, group)
55
-
56
58
  uuids = utils.build_keys(
57
59
  uuid_key, date,
58
60
  min_granularity=granularity,
59
- max_granularity=granularity)
61
+ max_granularity=max_granularity)
60
62
 
61
63
  for gran, key in zip(granularities, uuids):
62
64
  # DO not change slug to uuid_key so we can filter by group using group field
@@ -72,6 +74,7 @@ def gauge(slug, keys, data, granularity="daily", group=None, date=None, timezone
72
74
  group=group, start=utils.date_for_granulatiry(date, gran)))
73
75
  m.setMetrics(keys, data, created)
74
76
 
77
+
75
78
  def normalize_date(date=None, timezone=None, group=None):
76
79
  if date is None:
77
80
  date = utils.datetime.utcnow()
@@ -83,7 +86,8 @@ def normalize_date(date=None, timezone=None, group=None):
83
86
  date = date_util.convertToLocalTime(settings.METRICS_TIMEZONE, date)
84
87
  return date
85
88
 
86
- def get_qset(slug, granularity, start=None, end=None, group=-1, starts_with=False, ends_with=None):
89
+ def get_qset(slug, granularity, start=None, end=None,
90
+ group=-1, starts_with=False, ends_with=None):
87
91
  if start is None:
88
92
  start = utils.datetime.utcnow()
89
93
  if group is not None and group != -1:
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.117"
4
+ __version__ = "4.2.119"