django - query filter on manytomany is empty -
in django there way filter on manytomany field being empty or null.
class testmodel(models.model): name = models.charfield(_('set name'), max_length=200) manytomany = models.manytomanyfield('anothermodel', blank=true, null=true) print testmodel.objects.filter(manytomany__is_null=true)
print testmodel.objects.filter(manytomany=none)
Comments
Post a Comment