Hi all. I've been tawling around this afternoon trying to figure out
how to break away from a single monolithic controller. Based on posts
I've read here, creating a project using the tgbig template sets up
the infrastructure, but I'm having trouble getting going from there...
I've looked over the FAQ and the CherryPy docs, and what I'm doing
should be working based on what I read there, but I'm obviously
missing something.
controllers/__init__.py looks like this:
---
from w00tztest.controllers.root import Root
from w00tztest.controllers.customer import Customer
---
controllers/root.py loks like this:
---
from turbogears import controllers, expose, flash
class Root(controllers.RootController):
foo = Customer()
@expose(template="w00tztest.templates.welcome")
def index(self):
import time
flash("Your application is now running")
return dict(now=time.ctime())
---
and controllers/customer.py looks like this:
---
from turbogears import controllers, expose, flash
class Customer(controllers.Controller):
@expose(template="w00tztest.templates.welcome")
def index(self):
import time
flash("this is from the customer controller!")
return dict(now=time.ctime())
---
When starting the app, CherryPy crashes with the error:
File "root.py", line 9, in Root
foo = Customer()
NameError: name 'Customer' is not defined
What am I doing wrong here?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---