Menu
  • HOME
  • TAGS

Installing django-autocomplete-light examples

python,django,django-autocomplete-light

I ended up installing django as suggested (I need to use django 1.5 for GAE compatibility): pip install -e git+https://github.com/django/[email protected]#egg=django So I got further, but now it is saying: ImportError: No module named autocomplete_light.example_apps.non_admin_add_another I see that the module is referenced in settings.py: INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites',...

django-autocomplete-light django 1.8 custom modelform for admin

django,django-autocomplete-light

Following resolved my problem: before admin in INSTALLED_APPS INSTALLED_APPS = ( 'autocomplete_light', 'django.contrib.admin', ) autocomplete_light_registry.py class BannerAutocomplete(autocomplete_light.AutocompleteModelBase): model = Banner search_fields = ('name',) # banner_obj.product.name choices = Product.objects.all() limit_choices = 20 autocomplete_light.register( BannerAutocomplete, attrs={ 'placeholder': _(u'имя товара'), 'data-autocomplete-minimum-characters': 1, }, ) Manually select autocomplete for related field in your...

autocomplete_light is not showing correct suggestions with choice_for_request

django,django-models,django-forms,django-autocomplete-light

After going through various documents, the solution which worked as correctly as it should be is def choices_for_request(self): category = self.request.session.get('category','') item=self.request.GET.get('q','') choices = self.choices.all() if item: choices = choices.filter(item_name__icontains=item) super(AutoComplete, self).choices_for_request() if category: choices = choices.filter(product_type__name=category) return self.order_choices(choices)[0:self.limit_choices] I missed out item=self.request.GET.get('q','') autocomplete-light...

Django+autocomplete_light dynamic choiceField in form

python,django,sqlite,dictionary,django-autocomplete-light

I did it as simple add another like in administration panel: http://django-autocomplete-light.readthedocs.org/en/stable-2.x.x/addanother.html

django autocomplete light - limiting choiches for foreign key fields with limit_choiches_to

django,django-models,django-forms,django-admin,django-autocomplete-light

Typo: choiches in choiches = MyModels.objects.filter( ...

FieldError at /autocomplete/ItemsAutocomplete/

python,django,django-models,django-forms,django-autocomplete-light

You have forgottent a comma! Change search_fields=('item_name') to search_fields=('item_name',) search_fields should be an iterable, so if it has the value ('item_name') (which is a string) it will get 'i', 't', 'e', etc (that's why you get the message Cannot resolve keyword u'i' into field) Also, there are some serious problems...

how to create a dependant drop down using autocomplete light

django,django-models,django-forms,django-autocomplete-light

The self.request.POST (or self.request.GET) QueryDict of an Autocomplete class will not contain any more information than the search query because they are not passed when the view is created (so self.request.POST.get('category', 'none') will always return 'none'). So the difficult part is to somehow pass an argument (category) to a completely...