summaryrefslogtreecommitdiff
path: root/program/templatetags/content_boxes.py
blob: b56f0d29b24c6b55e94ff1efb868401c6690d256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# http://docs.djangoproject.com/en/1.2/howto/custom-template-tags/

from django import template
register = template.Library()

from program.models import BroadcastFormat, MusicFocus, ShowInformation, ShowTopic

@register.inclusion_tag('boxes/broadcastformat.html')
def broadcastformat():
    broadcastformats = BroadcastFormat.objects.filter(enabled=True)
    return {'broadcastformats': broadcastformats}

@register.inclusion_tag('boxes/musicfocus.html')
def musicfocus():
    musicfoci = MusicFocus.objects.all()
    return {'musicfoci': musicfoci}

@register.inclusion_tag('boxes/showinformation.html')
def showinformation():
    showinformations = ShowInformation.objects.all()
    return {'showinformations': showinformations}

@register.inclusion_tag('boxes/showtopic.html')
def showtopic():
    showtopics = ShowTopic.objects.all()
    return {'showtopics': showtopics}