def get_user_preferences(): # @ quick hack to avoid querying for user_preferences again and again if 'user_preferences' not in web.ctx: web.ctx.user_preferences = context.get('user') and web.ctx.site.get( context.user.key + "/preferences" ) return web.ctx.user_preferences
def __getitem__(self, key): key = self.process_key(key) root = web.rstrips(self.getroot() or "", "/") if root is None or context.get('rescue_mode'): raise KeyError, key value = self.templates[root + key] if isinstance(value, LazyTemplate): value = value.func() return value
def __getitem__(self, key): key = self.process_key(key) root = self.getroot() if root is None or context.get('rescue_mode'): raise KeyError(key) root = web.rstrips(root or "", "/") value = self.templates[root + key] if isinstance(value, LazyTemplate): value = value.func() return value
def get_user_preferences(): #@ quick hack to avoid querying for user_preferences again and again if 'user_preferences' not in web.ctx: web.ctx.user_preferences = context.get('user') and web.ctx.site.get(context.user.key + "/preferences") return web.ctx.user_preferences