django-autocomplete-light

django-autocomplete-light error = 'list' object has no attribute 'queryset'

北慕城南 提交于 2020-01-01 07:18:10
问题 i am new on django and i need your help, trying since many days to understand django-autocomplete-light, after setup my test, http://192.168.0.108:8000/country-autocomplete/ work, data is showed like explaned here http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#overview But after following next step, i am getting error: AttributeError at /auto 'list' object has no attribute 'queryset' Request Method: GET Request URL: http://192.168.0.108:8000/auto Django Version: 1.10

django-filter with django autocomplete-light

帅比萌擦擦* 提交于 2019-12-25 09:17:10
问题 I've been using simple DAL, and django-filter separately but I'm having trouble using DAL with django-filter. I've read this page : django-filter with django autocomplete light but I'm still confused. I have filter class like this below, and I want to use DAL on the "devname" field: class DevListFil(django_filters.FilterSet): devname = django_filters.CharFilter(name='devname',lookup_expr='icontains') sn = django_filters.CharFilter(name='sn',lookup_expr='icontains') devtype = django_filters

how to create a dependant drop down using autocomplete light

佐手、 提交于 2019-12-23 20:13:21
问题 I have created a form using Django Model Form and autocomplete_light . I want to filter the suggestions in the drop down list item according to the arguement passed when the class is called. My form is class CamenuForm(autocomplete_light.ModelForm): class Meta: model = Ca_dispensaries_item exclude = ('dispensary',) autocomplete_fields = ('item',) def __init__(self, *args, **kwargs): self.category = kwargs.pop('category', None) super(CamenuForm, self).__init__(*args, **kwargs) self.fields[

Error adding more fields with django-autocomplete-light

纵饮孤独 提交于 2019-12-22 00:12:22
问题 I have a problem and I am using 2 libraries : django-autocomplete-light and django-dynamic-formset . The 2 are very good at doing their job. The first is used to do autocomplete and the second to make django formsets are dynamic. but when you want to join these 2 a problem occurs. Image of the problem when a new field is created, it is added in that way. Template: {% extends 'base/base.html' %} {% load static %} {% block titulo%} Registrar venta {%endblock%} {% block contenido %} <div class=

how to create a autocomplete input field in a form using Django

可紊 提交于 2019-12-19 10:34:10
问题 I am pretty new to django and its ways. I am trying to create an autocomplete field for a form. My code is as below forms.py from django import forms class LeaveForm(forms.Form): leave_list = ( ('Casual Leave', 'Casual Leave'), ('Sick Leave', 'Sick Leave') ) from_email = forms.EmailField(required=True, widget=forms.TextInput(attrs={'style': 'width: 400px'})) start_date = end_date = forms.CharField(widget=forms.TextInput(attrs={'type': 'date', 'style': 'width: 175px'})) leave_type = forms

Fill two other fields of a formset depending on autocomplete selection

夙愿已清 提交于 2019-12-12 19:00:30
问题 I would like to fill two other fields automatically depending upon the selection someone makes in an autocomplete field, using django-autocomplete-light. However, my java script is not that good, so I don't really know where to start. Any help is very much appreciated. User submit their publicized papers. There is a "person" autocomplete field in a formset (its a many to many relation for authors and other people that worked towards the publication). If a user chooses a person, I want that

django-autocomplete-light not working - select2 is not a function

自作多情 提交于 2019-12-12 12:48:59
问题 I'm using django-autocomplete-light with django 1.8. It sometimes fails. Here is the javascript console error: TypeError: $(...).select2 is not a function ;(function ($) { $(document).on('autocompleteLightInitialize', '[data-autocomplete-light-function=select2]', function() { var element = $(this); // This widget has a clear button $(this).find('option[value=""]').remove(); $(this).select2({ It worked fine yesterday and nothing has changed but today it is not working. I'm also using django

Customising the output of items using django-autocomplete-light v3

﹥>﹥吖頭↗ 提交于 2019-12-12 04:27:51
问题 In earlier versions of django-autocomplete-light you could use a template to render each returned entry, which included the ability to insert custom HTML I can't figure out how to do that using the regular API, so I'm trying to add it in. So far I have a class like this which uses mark_safe and the HTML is being passed through: class TemplateRenderSelect2QuerySetView(autocomplete.Select2QuerySetView): def get_result_label(self, result): """Return the label of a result.""" template = get

django-autocompletion-light simple foreign key completion shows not editable drop-down widget

浪尽此生 提交于 2019-12-11 06:30:06
问题 I have a model for countries: class Country(models.Model): name = models.CharField(max_length=200) def __str__(self): return self.name That is referred by a foreign key in the UserDetails model: class UserDetails(models.Model): ... country = models.ForeignKey(Country,verbose_name='Country',null=True, blank=True, default = None) By using django-autocomplete-light I would light that when inserting the country I have a text widget that completes while writing the first letters. Thus, I have

'list' object has no attribute 'queryset' error when adding a autocomplete field to a model-form

寵の児 提交于 2019-12-08 13:43:10
问题 I want to add an another autocomplete field to my model.form. However, as soon as I add the autocomplete widget for the field "projektnummer" 'projektnummer': autocomplete.ModelSelect2(url='output:projekt-form-autocomplete'), I get an wired template error I cannot make sense of. Do you have some ideas what I can do here? Thank you very much! :) error message: AttributeError at /output/create/ 'list' object has no attribute 'queryset' Request Method: GET Request URL: http://127.0.0.1:8000