def product_feed(request, category=None, template="product_feeds/googlebase_atom.xml", mimetype="application/atom+xml"):
    """Build a feed of all active products.
    """

    shop_config = Config.objects.get_current()
    if category:
        try:
            cat = Category.objects.active().get(slug=category)
            products = cat.active_products()
        except Category.DoesNotExist:
            raise Http404, _("Bad Category: %s" % category)
    else:
        cat = None
        products = Product.objects.active_by_site()
        
    products = filter(lambda product:"ConfigurableProduct" not in product.get_subtypes(), products)
    
    params = {}
    view = 'satchmo_atom_feed'
    if category:
        params['category'] = category
        view = 'satchmo_atom_category_feed'
    
    url = shop_config.base_url + urlresolvers.reverse(view, None, params)
    
    payment_choices = [c[1] for c in credit_choices(None, True)]
    
    return render_to_response(template, {
        'products' : products,
        'category' : cat,
        'url' : url,
        'shop' : shop_config,
        'payments' : payment_choices,
        'date' : datetime.datetime.now(),
        },
        mimetype=mimetype)
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/satchmo_ext/product_feeds/views.py/product_feed/original