Commits

Denis Darii committed 16ef6b4

added templatetags

  • Participants
  • Parent commits 0afd2e6

Comments (0)

Files changed (2)

File bisnavi/templatetags/__init__.py

Empty file added.

File bisnavi/templatetags/bisnavi_tags.py

+from django import template
+from bisnavi.models import Photo
+
+register = template.Library()
+
+
+@register.inclusion_tag('bisnavi/base.html')
+def setup_bisnavi():
+    """
+    Usage:
+        {% load bisnavi_tags %}
+        {% setup_bisnavi %}
+    load all needed html, css and js code
+    """
+
+    return {'protos': Photo.objects.all()}