models数据模型学习札记

models数据模型学习笔记from common.models import Baseclass ChildB(Base):pass这样,ChindA当中的m2m名称

models数据模型学习笔记

from common.models import Baseclass ChildB(Base):    pass

    这样,ChindA当中的m2m名称将是common_childa_related, 同时ChindB中的m2m名称为common_childb_related,而另一应用rare中的childB中的m2m为rare_childb_related.这样可以保证唯一性。

    注意:如果不指定related_name属性,系统会有默认的名称,可以查看相关资料。



(.....待续...)