Closed freddydrew closed 8 months ago
Remove Q lookups as part of pre-PostgreSQL search:
`# Define Custom QuerySet behavior class articleQuerySet(models.QuerySet): def search(self, query=None): if query is None or query == "" or query.strip() == '': return self.none() # Empty query list
lookups = Q(title__icontains=query) | Q( content__icontains=query) | Q( city__icontains=query) | Q( country__icontains=query) | Q( alpha3__icontains=query) | Q( slug__icontains=query) | Q( postType__icontains=query) return self.filter(lookups)
`
Remove Q lookups as part of pre-PostgreSQL search:
`# Define Custom QuerySet behavior class articleQuerySet(models.QuerySet): def search(self, query=None): if query is None or query == "" or query.strip() == '': return self.none() # Empty query list
Q lookups
`