Adds basic template tag for available categories. Currently does not check enabling conditions.

This commit is contained in:
Christopher Neugebauer 2016-03-25 14:16:30 +11:00
parent 478b328e41
commit c192fef491
2 changed files with 10 additions and 0 deletions

View file

View file

@ -0,0 +1,10 @@
from registrasion import models as rego
from django import template
register = template.Library()
@register.assignment_tag(takes_context=True)
def available_categories(context):
''' Returns all of the available product categories '''
return rego.Category.objects.all()