]> git.llucax.com Git - software/sercom.git/commitdiff
Bugfix: el menú en realidad debe buscar SecureResources, no Controllers.
authorLeandro Lucarella <llucax@gmail.com>
Sat, 10 Mar 2007 16:54:53 +0000 (16:54 +0000)
committerLeandro Lucarella <llucax@gmail.com>
Sat, 10 Mar 2007 16:54:53 +0000 (16:54 +0000)
sercom/menu.py
sercom/templates/master.kid

index a72d6a29bebf04bb98737bc6a19bc10682f75f0d..da714d168c7a10c2ac8ee6e73b01c421f5f94346 100644 (file)
@@ -1,12 +1,14 @@
+# vim: set et sw=4 sts=4 encoding=utf-8 foldmethod=marker :
 
 from turbogears import url
-from turbogears.controllers import Controller
+from turbogears.identity import SecureResource
 from turbogears import identity
 
 class Menu:
     def __init__(self, base):
         self.base = base
-        self.items = filter(lambda i: isinstance(getattr(base, i), Controller), base.__dict__)
+        self.items = [i for i in dir(base)
+            if isinstance(getattr(base, i), SecureResource)]
         self.items.sort()
         self.items = ['dashboard'] + self.items
 
index 48ae3143f4ed1185c34ff65eff59b80489fc4949..b23c32195590f066b94f807beb52fa08d6b06c55 100644 (file)
@@ -1,7 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <?python import sitetemplate ?>
 <?python
-       from sercom.menu import Menu 
+       from sercom.menu import Menu
        from sercom.controllers import Root
        menu = Menu(Root)
 ?>