summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-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)