Hello all,
I'm doing a small web service using the tgwebservices module. My app
has a small database containing a buch of tables with user information
and photos associated to users. From the python interpreter (tg-admin
shell), I'm able to get all the entries from my User table just by
typing:
>>> users = User.select()
>>> users.count()
2L
So far so goos, I implement the same code in controollers.py:
@wsexpose(str)
def getUsers(self):
users = User.select()
return "There are %s users in the DB" % users.count()
And I get the following error message:
users = User.select() AttributeError: ("type object 'User' has no
attribute 'select'")
I don't understand this behavior. What's wrong? I'm querying the same
database. Why is it not working in the web service?? Any idea? Thanks
in advance.
--
Víctor Peinado
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---