You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to find an item on the field, nothing is found.
Django shows django.core.exceptions.FieldError: Related Field got invalid lookup: icontains
and the error seem to be at the line 27 on the view,
values = model.objects.filter(**{'{}__icontains'.format(search_field): value})[:limit]
I'm working with Django 2.0.1
The text was updated successfully, but these errors were encountered:
Models.py:
Class Time(models.Model):
some lines...
Class Meta:
abstract = True
Class Gateway(Time):
Serial = models.PositiveIntegerField(primary_key = True)
some lines....
Class Firmware(Time):
Serial = models.ManyToManyField(Gateway, blank = True, related_name = 'Gw_Serial')
Groups = models.ManyToManyField('Group', blank = True)
File = models.FileField(....arguments) 'I found that other peoples have similar issues with file fields'
Admin.py:
from searchableselect.widgets import SearchableSelect
other imports...
class formFix(forms.ModelForm):
class Meta:
model = Firmware
exclude = []
widgets = {
'Serial': SearchableSelect(model='fwupdate.Firmware', search_field='Serial', many=True, limit=10)
}
class FirmwareAdmin(admin.ModelAdmin):
form = formFix
admin.site.register(Firmware, FirmwareAdmin)
Tell me if you need more information.
PS: This widget can be used to multiple select like does with chosen.js?
When I try to find an item on the field, nothing is found.
Django shows django.core.exceptions.FieldError: Related Field got invalid lookup: icontains
and the error seem to be at the line 27 on the view,
values = model.objects.filter(**{'{}__icontains'.format(search_field): value})[:limit]
I'm working with Django 2.0.1
The text was updated successfully, but these errors were encountered: