Changeset - 4021aa3c8ebc
[Not reviewed]
0 1 0
Christopher Neugebauer - 8 years ago 2016-04-06 06:33:04
chrisjrn@gmail.com
Resolves #12 — each item category shows what items you have already purchased in each category
1 file changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
registrasion/templatetags/registrasion_tags.py
Show inline comments
...
 
@@ -37,4 +37,5 @@ def items_pending(context):
 
@register.assignment_tag(takes_context=True)
 
def items_purchased(context):
 
    ''' Returns all of the items that this user has purchased '''
 
def items_purchased(context, category=None):
 
    ''' Returns all of the items that this user has purchased, optionally
 
    from the given category. '''
 

	
...
 
@@ -45,2 +46,5 @@ def items_purchased(context):
 

	
 
    if category:
 
        all_items = all_items.filter(product__category=category)
 

	
 
    products = set(item.product for item in all_items)
0 comments (0 inline, 0 general)