myslice prefixed queries to speed up the portal
[myslice.git] / portal / platform.py
1 from manifold.core.query                import Query
2 from manifoldapi.manifoldapi            import execute_query
3
4 class Platform:
5     def __init__ (self, id = None, name = None):
6         if id is not None:
7             platform_query  = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled').filter_by('platform_id', '==', platform_id)
8         if name is not None:
9             platform_query  = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled').filter_by('platform', '==', platform)
10  
11         self.id       = platform_query['platform_id']
12         self.name     = platform_query['platform']
13         self.type     = platform_query['gateway_type']
14         self.disabled = platform_query['disabled']
15
16 #class Platforms:
17 #    def __init__ (self):
18 #        platforms_query  = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled')
19 #        platforms_details = execute_query(self.request, platform_query)
20 #        for platform_detail in platforms_details:
21 #            Platform(id = platform_detail['platform_id'])