many to many - django manytomany filter question -


grass,

I have a model that looks like this

  class person (models.Model): name = models.CharField (empty = wrong, max_length = 100) friend = model. ManyToManyField ('self', empty = true, zero = true)  
<

I tried

  people_with_friends = person.objects.filter (friends = true)   

thanks

What about it?

  people_in different friends = person.objects.exclude (friend = none)  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -