Hello,
I'm trying to use TGNewTraversal and need some explaination :
My urls have the following form : /X, /X/admin, /X/admin/subadmin,
/X/update, etc...
I first played with childFactory and it works well for the X level.
class Root(RootResource):
...
def childFactory(self, id):
return ManageX(id)
class ManageX(Resource):
def __init__(self, id):
self.id = id
Then I wanted to structure the different classes and have a class Admin
and have something similar than what you do with RootController and
Controller like
admin = Admin(id)
so I tryed to define self.child_admin = Admin(id) within the the
__init__ method of ManageX and got a "Admin object is not callable"
error when I tried to access the page.
When looking at traversal.py I discovered that in the case of a child_*
syntax, the call was made as resource(w()) instead of resource(w) as it
is done when you define children = dict(admin=Admin(id)) or with
childFactory. Can you explain why ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---