Ejemplo n.º 1
0
def display_bestsellers(request, count=0, template="product/best_sellers.html"):
    """Display a list of the products which have sold the most"""
    if count == 0:
        count = config_value("PRODUCT", "NUM_PAGINATED")

    ctx = RequestContext(request, {"products": bestsellers(count)})
    return render_to_response(template, ctx)
Ejemplo n.º 2
0
def best_selling_products_list(count):
    """Get a list of best selling products"""
    try:
        ct = int(count)
    except ValueError:
        ct = config_value('PRODUCT','NUM_PAGINATED')

    return bestsellers(ct)
Ejemplo n.º 3
0
def best_selling_products_list(count):
    """Get a list of best selling products"""
    try:
        ct = int(count)
    except ValueError:
        ct = config_value('PRODUCT', 'NUM_PAGINATED')

    return bestsellers(ct)
Ejemplo n.º 4
0
def display_bestsellers(request, count=0, template='product/best_sellers.html'):
    """Display a list of the products which have sold the most"""
    if count == 0:
        count = config_value('PRODUCT','NUM_PAGINATED')
    
    ctx = RequestContext(request, {
        'products' : bestsellers(count),
    })
    return render_to_response(template, context_instance=ctx)
Ejemplo n.º 5
0
def display_bestsellers(request,
                        count=0,
                        template='product/best_sellers.html'):
    """Display a list of the products which have sold the most"""
    if count == 0:
        count = config_value('PRODUCT', 'NUM_PAGINATED')

    ctx = RequestContext(request, {
        'products': bestsellers(count),
    })
    return render_to_response(template, context_instance=ctx)
Ejemplo n.º 6
0
def display_bestsellers(request,
                        count=0,
                        template='product/best_sellers.html'):
    """Display a list of the products which have sold the most"""
    if count == 0:
        count = config_value('PRODUCT', 'NUM_PAGINATED')

    ctx = {
        'products': bestsellers(count),
    }
    return render(request, template, ctx)
def bestsellers(n):
    return bestsellers(n)
Ejemplo n.º 8
0
 def get_queryset(self):
     if self.count == 0:
         self.count = config_value('PRODUCT', 'NUM_PAGINATED')
     return bestsellers(self.count)