Unsupported "istartwith" lookup for CharField or attachment not allowed
I have created several models using Django ORM.
class feed(models.Model):
location = models.OneToOneField('feedlocation')
class feedlocation(models.Model):
areaHash = models.CharField(max_length=100,default='')
Then I used the following code to find out the 'feed' on the same Hash area.
Feed.objects.filter(location__areaHash__istartwith='*****')
I got this error:
FieldError: Unsupported lookup 'istartwith' for CharField or join on the field not permitted.
What should I do to achieve this request?
+3
source to share