1 from django import template
2 from ssify import ssi_variable
3 from tests.views import QUOTES
5 register = template.Library()
8 @ssi_variable(register)
9 def random_number(request, limit):
10 # Guaranteed to be random as of XKCD#221
11 return min(limit - 1, 4)
14 @ssi_variable(register)
15 def number_of_quotes(request):
19 @ssi_variable(register)
20 def quote_len_odd(request, which):
21 return bool(len(QUOTES[which]) % 1)