Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_product(request, product_slug, template_name="product/details.html"):
- """
- Product Detail View
- """
- try:
- product = Product.objects.select_related().get(published=True, slug=product_slug)
- images = ProductImage.objects.filter(product=product.id)
- docs = ProductLiterature.objects.filter(product=product.id)
- except Product.DoesNotExist:
- return bad_or_missing(request, 'The product or page you have requested is not in the catalog.')
- return render_to_response(template_name, {
- "product": product,
- "images": images,
- "docs": docs,
- }, context_instance=RequestContext(request))
Add Comment
Please, Sign In to add comment