Subversion Repositories SmartDukaan

Rev

Rev 6183 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6183 Rev 6186
Line 19... Line 19...
19
    def __init__(self):
19
    def __init__(self):
20
        
20
        
21
        try:
21
        try:
22
            client = CatalogClient().get_client()
22
            client = CatalogClient().get_client()
23
            self.brands = client.getAllBrandsByCategory(10001)
23
            self.brands = client.getAllBrandsByCategory(10001)
-
 
24
            self.brands.extend(client.getAllBrandsByCategory(11001))
24
        except Exception:
25
        except Exception:
25
            self.brands = ['Micromax', 'BlackBerry', 'Blackberry', 'Motorola', 'Alcatel', 'Sony Ericsson', 'Apple', \
26
            self.brands = ['Micromax', 'BlackBerry', 'Blackberry', 'Motorola', 'Alcatel', 'Sony Ericsson', 'Apple', \
26
                      'Spice', 'Nokia', 'HTC', 'Samsung', 'LG', 'Dell', 'Karbonn', 'Lava', 'Canon', 'Nikon', 'Sony']
27
                      'Spice', 'Nokia', 'HTC', 'Samsung', 'LG', 'Dell', 'Karbonn', 'Lava', 'Canon', 'Nikon', 'Sony']
27
        
28
        
28
        self.brands.append('Blackberry') #To resolve issue of 'BlackBerry' and 'Blackberry'
29
        self.brands.append('Blackberry') #To resolve issue of 'BlackBerry' and 'Blackberry'
Line 186... Line 187...
186
    items.extend(catalog_client.getAllItemsByStatus(status.PAUSED))
187
    items.extend(catalog_client.getAllItemsByStatus(status.PAUSED))
187
    items.extend(catalog_client.getAllItemsByStatus(status.PAUSED_BY_RISK))
188
    items.extend(catalog_client.getAllItemsByStatus(status.PAUSED_BY_RISK))
188
    products = {}
189
    products = {}
189
    
190
    
190
    for item in items:
191
    for item in items:
191
        if item.category in (10002, 10003, 10004, 10005, 10010):  products[item.catalogItemId] = item
192
        if item.category in (10002, 10003, 10004, 10005, 10010, 11002, 11003):  products[item.catalogItemId] = item
192
    
193
    
193
    return sorted(products.itervalues(), key = lambda item: item.brand)
194
    return sorted(products.itervalues(), key = lambda item: item.brand)
194
 
195
 
195
def getProductName(item):
196
def getProductName(item):
196
    model_name = item.modelName.strip() if len(item.modelName.strip()) > 0 else None
197
    model_name = item.modelName.strip() if len(item.modelName.strip()) > 0 else None