django-utils

personal collection of django utilities
git clone https://git.ce9e.org/django-utils.git

commit
8e37f4e1e991fa23985ef3ab1f6ff2c9cb39e77e
parent
a7fa2bf106ac6dc7a685cb4db646bbc03067f8a4
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-09-15 09:11
Gardening

Diffstat

M utils/context_groups.py 5 +++--
M utils/datefields.py 3 ++-

2 files changed, 5 insertions, 3 deletions


diff --git a/utils/context_groups.py b/utils/context_groups.py

@@ -22,8 +22,7 @@ class ContextGroup(models.Model):
   22    22 
   23    23     def get_permissions(self):
   24    24         perms = self.permissions.values_list(
   25    -1             'content_type__app_label',
   26    -1             'codename'
   -1    25             'content_type__app_label', 'codename'
   27    26         )
   28    27         return ['{}.{}'.format(ct, name) for ct, name in perms]
   29    28 
@@ -78,7 +77,9 @@ def perm_cache(key):
   78    77                 perms = fn(self, user, obj=obj)
   79    78                 setattr(user, perm_cache_name, perms)
   80    79             return getattr(user, perm_cache_name)
   -1    80 
   81    81         return wrapper
   -1    82 
   82    83     return decorator
   83    84 
   84    85 

diff --git a/utils/datefields.py b/utils/datefields.py

@@ -44,7 +44,8 @@ class DateTimeInput(forms.SplitDateTimeWidget):
   44    44             date_attrs=date_defaults,
   45    45             time_format=TIME_FORMAT,
   46    46             time_attrs=time_defaults,
   47    -1             **kwargs)
   -1    47             **kwargs
   -1    48         )
   48    49 
   49    50 
   50    51 class DateFormField(forms.DateField):