On Sep 4, 5:36 pm, Florent Aide <[EMAIL PROTECTED]> wrote:
>
> Could you try adding
>
> from w00tztest.controllers.customer import Customer
>
> to root.py ?
>
> Florent.

Thanks.... I know this is a symptom of my failure to completely grok
Python modules. :)

That fixes it. I thought from reading this post that adding imports to
__init__.py was sufficient, though?
http://groups.google.com/group/turbogears/browse_thread/thread/61bb34312502c444/6a4b64021e1ef856?

I wound up with the above code while simplifying my implementation to
figure out what the problem is with this controller implementation,
and thought the import in root.py might be somehow "hiding" methods on
Customer:

customer.py:
---
from turbogears import controllers, expose, flash

class Customer(controllers.Controller):
    @expose(template="w00tztest.templates.customer_search")
    def index(self):
        return self.find("all")

        @expose(template="w00tztest.templates.customer_search")
        def find(self, search):
                customers =
w00tztest.model.Customer.select(orderBy=w00tztest.model.Customer.q.lastName)
                return dict(search=search, customers=customers)
---

http://localhost:8080/foo/
500 Internal error
The server encountered an unexpected condition which prevented it from
fulfilling the request.
[...]
File "customer.py", line 11, in index
    return self.find("all")
AttributeError: 'Customer' object has no attribute 'find'

http//localhost:8080/foo/find
404 Not Found

The path '/foo/find' was not found.

Care to try for 2-of-2?


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to