Coverage for /home/tribaal/workspace/django-shop/shop/views/product: 83.33%

# Coverage for /home/tribaal/workspace/django-shop/shop/views/product : 83.33%

## 10 statements 9 run 1 missing 0 excluded 1 partial

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # -*- coding: utf-8 -*- from shop.models.productmodel import Product from shop.views import ShopDetailView class ProductDetailView(ShopDetailView): """ This view handles displaying the right template for the subclasses of Product. It will look for a template at the normal (conventional) place, but will fallback to using the default product template in case no template is found for the subclass. """ model = Product # It must be the biggest ancestor of the inheritence tree. generic_template = 'shop/product_detail.html' def get_template_names(self): ret = super(ProductDetailView, self).get_template_names() 20 if not self.generic_template in ret: ret.append(self.generic_template) return ret