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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -