@register.inclusion_tag('customer/history/recently_viewed_products.html', takes_context=True)
def recently_viewed_products(context, current_product=None):
 request = context['request']
 products = history.get(request)
 if current_product:
  products = [p for p in products if (p != current_product)]
 return {'products': products, 'request': request}

@ register . inclusion_tag ( 'customer/history/recently_viewed_products.html' , takes_context = True ) def recently_viewed_products ( context , current_product = None ) : request = context [ 'request' ] products = history . get ( request ) if current_product : products = [ p for p in products if ( p != current_product ) ] return { 'products' : products , 'request' : request }
inclusion tag listing the most recently viewed products .