Django 1.11. I have a model Article, and another model ReadArticles.
class Article(models.Model):
name = models.CharField()
length = models.IntegerField()
class ReadArticle(models.Model):
user = models.ForeignKey(User)
article = models.ForeignKey(Article)
I want to get a list of all articles which have not been read. I am already using Q:
length_filter = Q(length__lt=5000)
unread_articles = Article.objects.filter(length_filter).all()
How to I extend this to exclude all articles whose ID/User combination are in the read_articles table?