我对django中的ManyToManyField
有两种可能性:
将它放在“父”类中:
from django.db import models
class Person(models.Model):
pass
class Group(models.Model):
members = models.ManyToManyField(Person, related_name='group')
将其放入“子”类
from django.db import models
class Group(models.Model):
pass
class Person(models.Model):
groups = models.ManyToManyField(Group, related_name='members')
这两个选项有什么区别?
是否有理由让一方优先于另一方?