【文件属性】:
文件名称:django-polymodels:Django的多态模型实现
文件大小:24KB
文件格式:ZIP
更新时间:2021-05-04 14:50:45
Python
django-polymodels
django应用程序,提供了一种简单的方法来检索转换为原始ContentType模型类型。
安装
>>> pip install django - polymodels
确保'django.contrib.contenttypes'和'polymodels'在您的INSTALLED_APPS中
INSTALLED_APPS += ('django.contrib.contenttypes', 'polymodels')
用法
子类PolymorphicModel ,一个抽象模型类。
from django.db import models
from polymodels.models import PolymorphicModel
class Animal(PolymorphicModel):
name = models.CharFiel
【文件预览】:
django-polymodels-master
----MANIFEST.in(34B)
----README.rst(5KB)
----.coveragerc(61B)
----.github()
--------workflows()
----tests()
--------models.py(1KB)
--------test_forms.py(1KB)
--------test_managers.py(8KB)
--------__init__.py(0B)
--------migrations()
--------settings.py(258B)
--------test_related.py(601B)
--------test_fields.py(8KB)
--------base.py(304B)
--------test_models.py(8KB)
--------forms.py(397B)
----tox.ini(1KB)
----LICENSE(1KB)
----setup.cfg(191B)
----polymodels()
--------models.py(7KB)
--------managers.py(4KB)
--------utils.py(664B)
--------__init__.py(55B)
--------fields.py(6KB)
--------forms.py(989B)
----setup.py(1KB)
----.gitignore(70B)