def brand_page(request, brandname):
    try:
        brand = Brand.objects.by_slug(brandname)
        
    except Brand.DoesNotExist:
        raise Http404(_('Brand "%s" does not exist') % brandname)

        
    products = list(brand.active_products())
    sale = find_best_auto_discount(products)

    ctx = {
        'brand' : brand,
        'products': products,
        'sale' : sale,
    }

    ctx = RequestContext(request, ctx)
    signals.index_prerender.send(BrandProduct, request=request, context=ctx, brand=brand, object_list=products)

    return render_to_response('brand/view_brand.html',
                              context_instance=ctx)
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/satchmo_ext/brand/views.py/brand_page/original