в папке templatetags создаем файл my_tags.py
from django import template
register = template.Library()
@register.inclusion_tag('split_tags.html')
def split_tags(context, tags):
return {"tags": tags.split(',')
в папке template файл split_tags.html
{% for tag in tags %}
{{ tag }}
{% endfor %}
в шаблоне
{% load my_tags %}
{% for page in pages %}
{{ page.author }}
{{ page.date }}
{% split_tags page.tags %}
{% endfor %}
Updated 25 Jan. 2013, 21:55 by NikitaKurinny.