python - Django:有什么区别(rel & field)

标签 python django entity-relationship

Django的models.ManyToManyFieldmodels.ManyToManyRel有什么区别?我对这些东西感到困惑。

最佳答案

ManyToManyRel 使用ManyToManyRel 来实现它扩展的Field 基类的关系对象。如果您要创建一个扩展 Field 类并包含多对多关系的新字段类,您可能会发现此类很方便,但不应在您的模型中使用它(您将在此处看到弹出建议如果您的编辑器列出了可用的调用)。

见类字段@: https://github.com/django/django/blob/master/django/db/models/fields/__init__.py 类 ManyToManyRel & 类 ManyToManyField @: https://github.com/django/django/blob/master/django/db/models/fields/related.py

我很高兴这里的绝大多数问题都是可以通过查看引用资料和文档来回答的问题。研究和分享想法并挖掘“不供外部使用”的代码是很有趣的。我知道如何开始回答这个问题,如果我不这样做,我就不会写任何东西。好问题伙计!

关于python - Django:有什么区别(rel & field),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5216891/

相关文章:

python - OpenAI 将自定义游戏集成到健身房环境中

python - 如何让子弹击中敌人时出现血迹

python - Django 加权百分比

python - 如何在 Spyder IDE 中打开项目文件夹?

database-design - Linux 下 PostgresQL 的高质量 ERD 生成器?

c# - 使用 Entity Framework 加载嵌套实体/集合

python - %load_ext rpy2.ipython 错误

python - 为 Django 应用程序编写好的测试

c# - 自引用实体 - 多对多

python - PocketSphinx python 和设置声学模型?