Beispiel #1
0
def popular_by_category(request, slug):
    category = get_object_or_404(Category, slug=slug)
    return {
        'items': [get_item_json_synopsis(item) for item in Item.list_popular_by_category(category, 12)], 
    }
Beispiel #2
0
def popular_by_publisher(request, id):
    publisher = get_object_or_404(Publisher, pk=id)
    return {
        'items': [get_item_json_synopsis(item) for item in Item.list_popular_by_publisher(publisher, 12)], 
    }