How to Access Many to many field in class based views in Django?
问题 I have two models, Author & Book in models.py class Author(models.Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=40) email = models.EmailField() age = models.IntegerField() def __str__(self): return '%s %s' %(self.first_name, self.last_name) def __unicode__(self): return '%s %s' %(self.first_name, self.last_name) class Book(models.Model): title = models.CharField(max_length=100) #name = title pages = models.IntegerField() price = models