Example #1
0
File: chapter.py Project: TZM/zmgc
 def _get_resource(self, name):
     # we need to get to the root
     root = self.get_root()
     print root.name
     if name in ('chapters', 'chapters.metadata'):
         return root._get_resource(name)
     if name in ('users', 'users.metadata'):
         return root._get_resource(name)
     return WebSite._get_resource(self, name)
Example #2
0
File: project.py Project: TZM/zmgc
 def _get_resource(self, name):
     if name == "ui":
         ui = UI(ui_path)
         ui.database = self.metadata.database
         return ui
     # we need to get to the root
     root = self.get_root()
     if name in ("chapters", "chapters.metadata"):
         return root._get_resource(name)
     if name in ("projects", "projects.metadata"):
         return root._get_resource(name)
     if name in ("users", "users.metadata"):
         return root._get_resource(name)
     return WebSite._get_resource(self, name)
Example #3
0
File: phoenix.py Project: TZM/zmgc
 def _get_resource(self, name):
     if name == 'ui':
         ui = UI(ui_path)
         ui.database = self.metadata.database
         return ui
     # we need to get to the root
     root = self.get_root()
     if name in ('users', 'users.metadata'):
         return root._get_resource(name)
     if name in ('chapters', 'chapters.metadata'):
         return root._get_resource(name)
     if name in ('projects', 'projects.metadata'):
         return root._get_resource(name)
     if name in ('countries', 'countries.metadata'):
         return root._get_resource(name)
     return WebSite._get_resource(self, name)