Changes between Initial Version and Version 1 of Ticket #29582
- Timestamp:
- Jul 20, 2018, 2:42:42 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29582
- Property Component Uncategorized → contrib.postgres
- Property Triage Stage Unreviewed → Accepted
- Property Summary postgresql SearchVector error when try to add integerfield to it → SearchVector doesn't support querying non-text fields
- Property Type Uncategorized → Bug
-
Ticket #29582 – Description
initial v1 1 Hi,2 3 1 I try to implement autocomplete on my place table that look like below: 4 5 **class Place(models.Model):2 {{{ 3 class Place(models.Model): 6 4 name = models.CharField(max_length=80, blank=True) 7 5 num = models.IntegerField(null=True) … … 16 14 address = "{0}, {1}, {2}, {3}".format(self.num, self.street, 17 15 self.postal_code, self.city, self.country) 18 return address **19 16 return address 17 }}} 20 18 and in my function that return the result for display my address on frontend is like (self.q is a GET param from ajax call): 21 19 22 **qs = Place.objects.all() 23 qs .annotate(search=SearchVector('street', 'country','city', 'num')).filter(search__icontains=self.q)**24 25 20 {{{ 21 qs = Place.objects.all() 22 qs.annotate(search=SearchVector('street', 'country','city', 'num')).filter(search__icontains=self.q) 23 }}} 26 24 I have this error when the ajax call run: 27 25 {{{ 28 26 File "/opt/coupdepouce/lib/python3.6/site-packages/django/db/backends/utils.py", line 64, in execute 29 27 return self.cursor.execute(sql, params) 30 28 django.db.utils.DataError: invalid input syntax for integer: "" 31 29 LINE 1: ...city", '') || ' ' || COALESCE("user_place"."num", '')) AS "s... 32 33 30 }}}