Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)