mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-04-26 05:27:12 +00:00
Formatting...
This commit is contained in:
@@ -443,7 +443,6 @@ class Event(models.Model, RevisionMixin):
|
||||
else:
|
||||
return endDate
|
||||
|
||||
|
||||
@property
|
||||
def internal(self):
|
||||
return bool(self.organisation and self.organisation.union_account)
|
||||
|
||||
@@ -122,12 +122,13 @@ def orderby(request, field, attr):
|
||||
@register.filter(needs_autoescape=True)
|
||||
def get_field(obj, field, autoescape=True):
|
||||
value = getattr(obj, field)
|
||||
if(type(value)==bool):
|
||||
if(isinstance(value, bool)):
|
||||
value = yesnoi(value, field in obj.inverted_fields)
|
||||
elif(type(value)==str):
|
||||
elif(isinstance(value, str)):
|
||||
value = truncatewords(value, 20)
|
||||
return mark_safe(value)
|
||||
|
||||
|
||||
@register.filter
|
||||
def help_text(obj, field):
|
||||
if hasattr(obj, '_meta'):
|
||||
@@ -139,6 +140,7 @@ def verbose_name(obj, field):
|
||||
if hasattr(obj._meta.get_field(field), 'verbose_name'):
|
||||
return obj._meta.get_field(field).verbose_name
|
||||
|
||||
|
||||
@register.filter
|
||||
def get_list(dictionary, key):
|
||||
return dictionary.getlist(key)
|
||||
|
||||
Reference in New Issue
Block a user