Subversion Repositories SmartDukaan

Rev

Rev 7190 | Rev 7256 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7190 Rev 7202
Line 539... Line 539...
539
        if child_categories is not None:
539
        if child_categories is not None:
540
            all_categories = all_categories + child_categories 
540
            all_categories = all_categories + child_categories 
541
        query = query.filter(Item.category.in_(all_categories))
541
        query = query.filter(Item.category.in_(all_categories))
542
    if brand is not None:
542
    if brand is not None:
543
        query = query.filter_by(brand=brand)
543
        query = query.filter_by(brand=brand)
544
    query = query.order_by(asc(Item.bestSellingRank))
544
    query = query.group_by(Item.catalog_item_id).order_by(asc(Item.bestSellingRank))
545
    return query
545
    return query
546
 
546
 
547
def get_best_deals(category=-1):
547
def get_best_deals(category=-1):
548
    '''
548
    '''
549
    Returns the Best deals in the given category. Ignores the category if it's passed as -1.
549
    Returns the Best deals in the given category. Ignores the category if it's passed as -1.