I have a Model:
class Authors(models.Model):
name = models.TextField()
person = models.ForeignKey(Person)
and query:
authors = Author.objects.filter(
(Q(name__iregex=r"\y{0}\y".format(s1)),
~Q(name__iregex=r"\y{0}\y".format(s2))
),
person=None).order_by('-id')
I am getting the error:
'Q' object has no attribute 'split'
why is this? i am not using split()
though.. the line of error is in this query line.
\y
match? I've never seen it before. – Swap