Re: YUI Autocomplete
> Dear all, > I'm trying to put YUI autocomplete in my form, following this > tutorial:http://www.djangosnippets.org/snippets/392/ I've slightly updated the snippet code but I can't check it now so if you'll try it then let me know if something is still wrong. -- Maciej Wisniowski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: YUI Autocomplete
Hi! This is my snippet, that you're using, so I hope I can help :) > 1) Inside the my form class, if I specify: > > def __init__(self,*args, **kwargs ): > super(QuizForm, self).__init__(*args, > **kwargs) > n_lookup_url = reverse('djangoOp.op.views.json_lookup') # url to your > view > n_schema = '["resultset.results", > "tag", ]' > forms.fields['tags'].widget = AutoCompleteWidget() > forms.fields['tags'].widget.lookup_url = n_lookup_url > forms.fields['tags'].widget.schema = n_schema > > I receive: > > unsubscriptable object > on line: > forms.fields['tags'].widget = AutoCompleteWidget() If you're writting this in form's __init__ method then use: self.fields['tags'].widget = AutoCompleteWidget() self.fields['tags'].widget.lookup_url = n_lookup_url self.fields['tags'].widget.schema = n_schema -- Maciej Wisniowski --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
YUI Autocomplete
Dear all, I'm trying to put YUI autocomplete in my form, following this tutorial: http://www.djangosnippets.org/snippets/392/ There are two main problems: 1) Inside the my form class, if I specify: def __init__(self,*args, **kwargs ): super(QuizForm, self).__init__(*args, **kwargs) n_lookup_url = reverse('djangoOp.op.views.json_lookup') # url to your view n_schema = '["resultset.results", "tag", ]' forms.fields['tags'].widget = AutoCompleteWidget() forms.fields['tags'].widget.lookup_url = n_lookup_url forms.fields['tags'].widget.schema = n_schema I receive: unsubscriptable object on line: forms.fields['tags'].widget = AutoCompleteWidget() 2) I overcome the last problem through AutoCompleteWidget __init__ function. Unfortunately I receive another, more serious, error: 'AutoCompleteWidget' object has no attribute 'attrs' Do I make some terrible mistakes or tutorial miss some information ? I think Autocomplete and other ajax stuff could improve a lot the whole Django project, but right now I feel the integration too much complicated! Is it just my impression? Lorenzo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---