accrete 0.0.85__py3-none-any.whl → 0.0.86__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.
- accrete/contrib/ui/templatetags/accrete_ui.py +18 -1
- {accrete-0.0.85.dist-info → accrete-0.0.86.dist-info}/METADATA +1 -1
- {accrete-0.0.85.dist-info → accrete-0.0.86.dist-info}/RECORD +5 -5
- {accrete-0.0.85.dist-info → accrete-0.0.86.dist-info}/WHEEL +0 -0
- {accrete-0.0.85.dist-info → accrete-0.0.86.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,6 @@
|
|
1
1
|
import logging
|
2
|
-
from datetime import timedelta
|
2
|
+
from datetime import datetime, date, timedelta
|
3
|
+
from django.utils.translation import gettext_lazy as _
|
3
4
|
from django import template
|
4
5
|
from django.db.models import Manager
|
5
6
|
from django.forms import Form, ModelForm
|
@@ -105,3 +106,19 @@ def timedelta_cast(td: timedelta, code: str) -> str | None:
|
|
105
106
|
if code not in codes:
|
106
107
|
return None
|
107
108
|
return str(getattr(td, code))
|
109
|
+
|
110
|
+
|
111
|
+
@register.filter(name='weekday')
|
112
|
+
def datetime_to_weekday(dt: datetime|date, default=None):
|
113
|
+
if dt is None:
|
114
|
+
return default
|
115
|
+
mapping = {
|
116
|
+
1: _('Mon'),
|
117
|
+
2: _('Tue'),
|
118
|
+
3: _('Wed'),
|
119
|
+
4: _('Thu'),
|
120
|
+
5: _('Fri'),
|
121
|
+
6: _('Sat'),
|
122
|
+
7: _('Sun')
|
123
|
+
}
|
124
|
+
return mapping[dt.isoweekday()]
|
@@ -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=
|
192
|
+
accrete/contrib/ui/templatetags/accrete_ui.py,sha256=HH3DTcRmUW3Jw03PT5tyIw94mNV3KlPgVTPifBoSxBo,3473
|
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.
|
234
|
-
accrete-0.0.
|
235
|
-
accrete-0.0.
|
236
|
-
accrete-0.0.
|
233
|
+
accrete-0.0.86.dist-info/METADATA,sha256=g1AJ15ErqlZopQ4t34u9TM6rwL9jesGZ1L9H1FWrd0E,4952
|
234
|
+
accrete-0.0.86.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
235
|
+
accrete-0.0.86.dist-info/licenses/LICENSE,sha256=_7laeMIHnsd3Y2vJEXDYXq_PEXxIcjgJsGt8UIKTRWc,1057
|
236
|
+
accrete-0.0.86.dist-info/RECORD,,
|
File without changes
|
File without changes
|