add info about templatetags

This commit is contained in:
Fred 2016-04-22 16:00:01 +02:00
parent 234c1cff74
commit 47f43ebf2b
2 changed files with 19 additions and 0 deletions

View File

View File

@ -0,0 +1,19 @@
# coding=utf-8
from django import template
from wish.models import Wishlist
register = template.Library()
@register.filter(is_safe=True)
def add_xx(value):
return '%sxx' % value
@register.simple_tag
def current_time(format_string):
return datetime.datetime.now().strftime(format_string)
@register.inclusion_tag('wish/templatetags/wishlists_list.html')
def wishlists_list():
return { 'list': Wishlist.objects.all() }