diff options
author | luxagraf <sng@luxagraf.net> | 2024-01-27 15:16:53 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2024-01-27 15:16:53 -0600 |
commit | 4b2d0f06763345d45281f4d57ccdacbe1b0f1393 (patch) | |
tree | 8ed73e213de8c9a2f7bf5856d358fe66fa164141 | |
parent | 3562e295581d733039df0b72da3c993139cd5949 (diff) |
gtd: added new template tags
-rw-r--r-- | app/gtd/templatetags/__init__.py | 0 | ||||
-rw-r--r-- | app/gtd/templatetags/get_note_type.py | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/app/gtd/templatetags/__init__.py b/app/gtd/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/app/gtd/templatetags/__init__.py diff --git a/app/gtd/templatetags/get_note_type.py b/app/gtd/templatetags/get_note_type.py new file mode 100644 index 0000000..47da254 --- /dev/null +++ b/app/gtd/templatetags/get_note_type.py @@ -0,0 +1,11 @@ +from django import template +from django.template.defaultfilters import pluralize +from gtd.models import NoteType + +register = template.Library() + + +@register.simple_tag +def get_note_type(obj, *args): + name = NoteType(obj).name.title() + return str(name) |