Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #8
0
 def get_queryset(self):
     if self.count == 0:
         self.count = config_value('PRODUCT', 'NUM_PAGINATED')
     return bestsellers(self.count)