summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2024-01-27 15:16:53 -0600
committerluxagraf <sng@luxagraf.net>2024-01-27 15:16:53 -0600
commit4b2d0f06763345d45281f4d57ccdacbe1b0f1393 (patch)
tree8ed73e213de8c9a2f7bf5856d358fe66fa164141
parent3562e295581d733039df0b72da3c993139cd5949 (diff)
gtd: added new template tags
-rw-r--r--app/gtd/templatetags/__init__.py0
-rw-r--r--app/gtd/templatetags/get_note_type.py11
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)