Ejemplo n.º 1
0
 def html(subcategory_, group_, filters_, is_admin):
     if subcategory_ and group_:
         subcategory_ = get_sub_mem(subcategory_)
         group_ = get_group_mem(group_)
     if not subcategory_ or not group_:
         return Response(status=404)
     gifts = Gift.get_subcategory_group(group_, filters_, is_admin).run(
         limit=DEFAULT_REQUEST_COUNT)
     if not gifts:
         return redirect('/')
     return render_to_response('gift/categories.html', {
         'gifts': gifts,
         'list_title':
         u'Категория «%s», группа «%s»' % (
             subcategory_.name, group_.name
         ),
         'active_category': group_.key().id(),
         'subcategory': subcategory_,
         'group': group_
     })
Ejemplo n.º 2
0
 def html(group_, group_key_, last_gift_, filters_, is_admin):
     gifts = Gift.get_subcategory_group(group_, filters_, is_admin)
     gifts = gifts.run(limit=DEFAULT_REQUEST_COUNT, offset=last_gift_)
     if gifts:
         return render_to_response('gift/list.html', {'gifts': gifts})
     return render_to_response("empty.html")