g = Goal.objects.filter(Q(title__contains=term) | Q(desc__contains=term))
How can I add to my filter
that user=request.user
?
This doesn't work:
g = Goal.objects.filter(user=request.user, Q(title__contains=term) | Q(desc__contains=term))
Models:
class Goal(models.Model):
user = models.ForeignKey(User)
title = models.CharField(max_length=255)
desc = models.TextField()
SyntaxError: non-keyword arg after keyword arg
, which explains exactly what is going on. – Braw