In my models.py i have something like:
class LocationGroup(models.Model):
name = models.CharField(max_length=200)
class Report(models.Model):
name = models.CharField(max_length=200)
locationgroups = models.ManyToManyField(LocationGroup)
admin.py (standard):
admin.site.register(LocationGroup)
admin.site.register(Report)
When I enter the admin page for Report, it shows a nice multiple choice field. How can I add the same multiple choice field in LocationGroup? I can access all Reports by calling LocationGroup.report_set.all()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…