Skip to content
This repository was archived by the owner on Apr 29, 2022. It is now read-only.

Commit 5db3fd5

Browse files
committed
Added documentation
1 parent b0ab661 commit 5db3fd5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

conference/templatetags/conference.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,22 @@ def attrib_(ob, attrib):
123123

124124
@register.simple_tag
125125
def tickets(user):
126+
"""
127+
Return the list of tikets `user` has assigned to them, for the current
128+
conference only.
129+
130+
Example usage in a template
131+
{% load conference %}
132+
133+
{% if user.is_authenticated %}
134+
You are logged in and these are your tickets:
135+
{% tickets user as tickets %}
136+
137+
{% for ticket in tickets %}
138+
<p>{{ ticket }}</p>
139+
{% endfor %}
140+
{% else %}
141+
Booo! You need to login.
142+
{% endif %}
143+
"""
126144
return get_tickets_for_current_conference(user)

0 commit comments

Comments
 (0)