@register.simple_tag(takes_context=True)
def render_product(context, product):
 if (not product):
  return ''
 names = [('catalogue/partials/product/upc-%s.html' % product.upc), ('catalogue/partials/product/class-%s.html' % product.get_product_class().slug), 'catalogue/partials/product.html']
 template_ = select_template(names)
 context['product'] = product
 return template_.render(context)

@ register . simple_tag ( takes_context = True ) def render_product ( context , product ) : if ( not product ) : return '' names = [ ( 'catalogue/partials/product/upc-%s.html' % product . upc ) , ( 'catalogue/partials/product/class-%s.html' % product . get_product_class ( ) . slug ) , 'catalogue/partials/product.html' ] template_ = select_template ( names ) context [ 'product' ] = product return template_ . render ( context )
render a product snippet as you would see in a browsing display .