From 4b2d0f06763345d45281f4d57ccdacbe1b0f1393 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 27 Jan 2024 15:16:53 -0600 Subject: gtd: added new template tags --- app/gtd/templatetags/__init__.py | 0 app/gtd/templatetags/get_note_type.py | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 app/gtd/templatetags/__init__.py create mode 100644 app/gtd/templatetags/get_note_type.py (limited to 'app/gtd') diff --git a/app/gtd/templatetags/__init__.py b/app/gtd/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 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) -- cgit v1.2.3-70-g09d2