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()
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()