Howdy!

Resurrecting this thoroughly dead thread...

Has anyone worked on creating a comma-separated AutoCompleteField that's less of a hack than the following? (E.g. the following would work, but only when appending elements to the end.)

Jason Chu, you replied to the original thread mentioning that you had an in-house solution. Any hope? ;^)

On 20-Nov-06, at 7:47 PM, José de Paula Eufrásio Júnior wrote:
Well, on the absence of a way to make the Auto Complete widget work as
I want (because I am worse at js than I am at python), I did that as
the search_controller:

    @expose(allow_json = True)
    def complete(self, tagname):
        #POG!

        tags = ['linux', 'security', 'politics', 'sex', 'religion',
            'programming', 'scifi', 'theories', 'spaced tag']

        if ',' in tagname:
            tagname = tagname.split(',').pop().strip()

        if tagname == '':
            return dict(tag = [])

        reslist = []
        for tag in tags:
            if tag.startswith(tagname):
                reslist.append(tag)

        return dict(tag = reslist)

Thanks!

Matthew Bevan, Systems Administrator
Top Floor Computer Systems Ltd.



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