Hi everybody,
I was getting myself familiar with tw.dynforms (installed version
0.9.1) and AjaxLookup was of particular interest to me but I am unable
to make it work the way it's described in the tutorial. the field on
the form just doesn't show any selection.
I checked the source and found that AjaxLookup expects text_search
method in a table class (People), not search method like in the
tutorial. All in all I changed class People to look like this:
class People(Entity):
name = Field(String(100))
email = Field(String(100))
def __str__(self):
return self.name
def __json__(self):
return {'id':self.id, 'value':self.name, 'extra':self.email}
@classmethod
#def search(self, search):
def text_search(self, search):
return People.query.filter(People.name.like(search+'%')).all()
I also checked from the shell that text_search method returns record
objects but nothing appears when AjaxLookup fiels looses focus.
Does Ajax Lookup work or I did something wrong?
I am using turbogears 1.0.9 (tutorial is written with tg 1.0 as the
framework).
Puska
--
You received this message because you are subscribed to the Google Groups
"ToscaWidgets-discuss" 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/toscawidgets-discuss?hl=en.