예제 #1
0
파일: library.py 프로젝트: garbas/osha.oira
 def update(self):
     self.library = get_library(self.context)
     if not self.library:
         raise NotFound(self, 'library', self.request)
     self.depth = item_depth(aq_inner(self.context))
     self.at_root = not self.depth
     super(Library, self).update()
예제 #2
0
파일: library.py 프로젝트: EU-OSHA/Euphorie
 def update(self):
     """ Set view attributes to define the current library, depth and
     at_root, which is True when the context is the root of the library.
     """
     self.library = get_library(self.context)
     if not self.library:
         raise NotFound(self, 'library', self.request)
     self.depth = item_depth(aq_inner(self.context))
     self.at_root = not self.depth
     super(Library, self).update()