Django_many-to-many table query

= models.Book.objects.filter eee (nid = 24 ) .first ()
 # get all of the objects associated with nid 24 of this book, the author and get the object name 
rrr = eee.authors.all () .values ​​( ' name ' )
 print (rrr)

result:

 

Guess you like

Origin www.cnblogs.com/wangdianchao/p/12732187.html