accrete 0.0.82__py3-none-any.whl → 0.0.83__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,4 +1,5 @@
1
1
  import logging
2
+ from datetime import timedelta
2
3
  from django import template
3
4
  from django.db.models import Manager
4
5
  from django.forms import Form, ModelForm
@@ -93,4 +94,14 @@ def non_field_error_code(form: [Form|ModelForm], code: str) -> bool:
93
94
  for error in form.non_field_errors().as_data():
94
95
  if error.code and error.code == code:
95
96
  return True
96
- return False
97
+ return False
98
+
99
+
100
+ @register.filter(name='timedelta_cast')
101
+ def timedelta_cast(td: timedelta, code: str) -> str | None:
102
+ if not isinstance(td, timedelta):
103
+ return None
104
+ codes = ['days', 'hours', 'minutes', 'seconds', 'microseconds']
105
+ if code not in codes:
106
+ return None
107
+ return str(getattr(td, code))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: accrete
3
- Version: 0.0.82
3
+ Version: 0.0.83
4
4
  Summary: Django Shared Schema Multi Tenant
5
5
  Author-email: Benedikt Jilek <benedikt.jilek@pm.me>
6
6
  License: Copyright (c) 2023 Benedikt Jilek
@@ -189,7 +189,7 @@ accrete/contrib/ui/templates/ui/partials/table_field_float.html,sha256=GH_jFdpk8
189
189
  accrete/contrib/ui/templates/ui/partials/table_field_monetary.html,sha256=Wtod9vel2dD4vG8lUVLbtls4aU_2EG3p0E1QRRUSH10,166
190
190
  accrete/contrib/ui/templates/ui/partials/table_field_string.html,sha256=GH_jFdpk8wEJXv4QfO6c3URYrZGGLeuSyWwWl2cWxwQ,45
191
191
  accrete/contrib/ui/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
192
- accrete/contrib/ui/templatetags/accrete_ui.py,sha256=J7zn8h_iQKvqX6PzMjnuzK0Kj6XBJkrm_DPj2lu_YUw,2723
192
+ accrete/contrib/ui/templatetags/accrete_ui.py,sha256=KTuOeMJJAZ7d4WaXQMeP2LYjmt8CU6cNY7rf4BGpBYs,3063
193
193
  accrete/contrib/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
194
194
  accrete/contrib/user/admin.py,sha256=YS4iApli7XUaIl9GsEJxys2j8sepX0by88omYHjff-E,85
195
195
  accrete/contrib/user/apps.py,sha256=oHDrAiHf-G57mZLyxqGJzRY2DbPprGFD-QgyVJG_ruI,156
@@ -230,7 +230,7 @@ accrete/utils/dates.py,sha256=apM6kt6JhGrKgoT0jfav1W-8AUVTxNc9xt3fJQ2n0JI,1492
230
230
  accrete/utils/forms.py,sha256=IvxbXNpSd4a-JBgsTJhs2GHe-DCRWX-xnVPRcoiCzbI,3104
231
231
  accrete/utils/http.py,sha256=sUDwa9hpYAle7d0iJxIA5wQk2mK2BMENo7JyFBSPxKc,4475
232
232
  accrete/utils/models.py,sha256=EEhv7-sQVtQD24PEb3XcDUAh3VVhVFoMMLyFrDjGEaI,706
233
- accrete-0.0.82.dist-info/METADATA,sha256=gWgAGk2_kGewMLZQkrHVoY3tghGhzXqAZyj2TBvUIyk,4952
234
- accrete-0.0.82.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
235
- accrete-0.0.82.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
236
- accrete-0.0.82.dist-info/RECORD,,
233
+ accrete-0.0.83.dist-info/METADATA,sha256=g26OFyCBdhAsOVsC62P438tXUQTI4omKCtfidjp8nHI,4952
234
+ accrete-0.0.83.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
235
+ accrete-0.0.83.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
236
+ accrete-0.0.83.dist-info/RECORD,,