aboutsummaryrefslogtreecommitdiffstats
path: root/client/templatetags
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2021-08-19 12:19:41 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2021-08-19 12:20:00 +0200
commit9f474d32ef47b02868a31bd59eaf969087d67a16 (patch)
tree392dbb55ffd35623fc973e03e7ce29dc89a2acf0 /client/templatetags
parentRO documents for non primary groups (diff)
downloadscout-subs-9f474d32ef47b02868a31bd59eaf969087d67a16.tar.gz
scout-subs-9f474d32ef47b02868a31bd59eaf969087d67a16.zip
use query instead of for loop in client
Diffstat (limited to 'client/templatetags')
-rw-r--r--client/templatetags/__init__.py0
-rw-r--r--client/templatetags/app_filter.py7
2 files changed, 7 insertions, 0 deletions
diff --git a/client/templatetags/__init__.py b/client/templatetags/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/client/templatetags/__init__.py
diff --git a/client/templatetags/app_filter.py b/client/templatetags/app_filter.py
new file mode 100644
index 0000000..3120b8e
--- /dev/null
+++ b/client/templatetags/app_filter.py
@@ -0,0 +1,7 @@
+from django import template
+from client.models import KeyVal
+
+register = template.Library()
+@register.filter(name="doc_key")
+def doc_key(doc):
+ return KeyVal.objects.filter(container=doc) \ No newline at end of file