Hi:

I'm trying to pass a parameter to my SQLObject object to subset the select
list.  I'm getting the following error:

TypeError: decoding Unicode is not supported

Here is my controller code.  It works fine unless something is passed in the
searchText argument.  Do I need to do something to the string that passed in
before I give it to SQLObject?

   @tg.expose(template='motion.templates.administration.plants')
   def plants(self, *args, **kw):
       import time
       try:
           searchText = kw['searchText']
       except KeyError:
           searchText = ''
       if searchText:
           plants = Plant.select('name = \'%s\'' % (searchText),
orderBy='plantNumber')
       else:
           plants = Plant.select(orderBy='plantNumber')
       tmplDict = {'plants':plants, 'searchText':searchText}
       return dict(now=time.ctime(), menuLinks=self.menuLinks,
tmplDict=tmplDict, plantListWidget=plantListWidget)


This works Ok in the tg-admin shell, but I'm guessing that something is
happening to the string that is passed into the function that is causing
this.

Thanks!

           -Jim

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