Пример #1
0
def itemlist(request):
    item_data = Item.objects.all()
    itempac = imgselect_pac(item_data)

    item_list = arr(itempac)

    context = { 'item':item_list }
    return render(request, 'gallery/item.html', context)
Пример #2
0
def itemdetail(request, item_id):
    try:
        item_detail = Item.objects.get(pk=item_id)
    except Item.DoesNotExist:
        raise Http404("Item does not exist")

    item_d = imgselect_obj(item_detail)


    photos = Photo.objects.filter(
            item__pk = item_id
            )
    photo_pac = imgselect_pac(photos)

    photo_list = arr(photo_pac)

    
    context = {"item":item_d, "photos":photo_list}
    return render(request, 'gallery/item_detail.html', context)
Пример #3
0
def index(request):
    item_data = Item.objects.all()[:3]
    itempac = imgselect_pac(item_data)

    context = { 'item':itempac }
    return render(request, 'gallery/index.html', context)