I have two models:
class ArticleCategory(models.Model):
Category_name = models.CharField(max_length=50, null=False, blank=False)
def __str__(self):
return self.Category_name
class Article(models.Model):
Title = models.CharField(max_length=100, blank=False, null=False)
Content = tinymce_models.HTMLField(null=False, blank=False)
Category = models.ManyToManyField(ArticleCategory,blank=False)
Assuming that the user will create some categories without necessarily linking them to any article, how do I get all the ArticleCategory objects that at least have one Article object linked to them?