Subversion Repositories SmartDukaan

Rev

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

Rev 2101 Rev 3133
Line 1... Line 1...
1
from shop2020.clients.InventoryClient import InventoryClient
1
from shop2020.clients.CatalogClient import CatalogClient
2
 
2
 
3
'''
3
'''
4
Created on 26-May-2011
4
Created on 26-May-2011
5
 
5
 
6
@author: rajveer
6
@author: rajveer
Line 14... Line 14...
14
        print "Returning category list"
14
        print "Returning category list"
15
        
15
        
16
    def __new__(cls, *args, **kwargs):
16
    def __new__(cls, *args, **kwargs):
17
        if not cls._instance:
17
        if not cls._instance:
18
            cls._instance = super(CategoryManager, cls).__new__(cls, *args, **kwargs)
18
            cls._instance = super(CategoryManager, cls).__new__(cls, *args, **kwargs)
19
            client = InventoryClient().get_client()
19
            client = CatalogClient().get_client()
20
            t_categories = client.getAllCategories()
20
            t_categories = client.getAllCategories()
21
            for category in t_categories:
21
            for category in t_categories:
22
                cls.categories[category.id] = category
22
                cls.categories[category.id] = category
23
            for category in t_categories:
23
            for category in t_categories:
24
                if category.parent_category_id != 0:
24
                if category.parent_category_id != 0: