mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Simplified imports from django.db and django.contrib.gis.db.
This commit is contained in:
parent
469bf2db15
commit
335c9c94ac
113 changed files with 382 additions and 450 deletions
|
@ -3,15 +3,11 @@ from django.contrib.contenttypes.fields import (
|
|||
GenericForeignKey, GenericRelation,
|
||||
)
|
||||
from django.db import models
|
||||
from django.db.models.fields.related import (
|
||||
ForeignKey, ForeignObject, ForeignObjectRel, ManyToManyField, ManyToOneRel,
|
||||
OneToOneField,
|
||||
)
|
||||
|
||||
from .models import AllFieldsModel
|
||||
|
||||
NON_CONCRETE_FIELDS = (
|
||||
ForeignObject,
|
||||
models.ForeignObject,
|
||||
GenericForeignKey,
|
||||
GenericRelation,
|
||||
)
|
||||
|
@ -23,32 +19,32 @@ NON_EDITABLE_FIELDS = (
|
|||
)
|
||||
|
||||
RELATION_FIELDS = (
|
||||
ForeignKey,
|
||||
ForeignObject,
|
||||
ManyToManyField,
|
||||
OneToOneField,
|
||||
models.ForeignKey,
|
||||
models.ForeignObject,
|
||||
models.ManyToManyField,
|
||||
models.OneToOneField,
|
||||
GenericForeignKey,
|
||||
GenericRelation,
|
||||
)
|
||||
|
||||
MANY_TO_MANY_CLASSES = {
|
||||
ManyToManyField,
|
||||
models.ManyToManyField,
|
||||
}
|
||||
|
||||
MANY_TO_ONE_CLASSES = {
|
||||
ForeignObject,
|
||||
ForeignKey,
|
||||
models.ForeignObject,
|
||||
models.ForeignKey,
|
||||
GenericForeignKey,
|
||||
}
|
||||
|
||||
ONE_TO_MANY_CLASSES = {
|
||||
ForeignObjectRel,
|
||||
ManyToOneRel,
|
||||
models.ForeignObjectRel,
|
||||
models.ManyToOneRel,
|
||||
GenericRelation,
|
||||
}
|
||||
|
||||
ONE_TO_ONE_CLASSES = {
|
||||
OneToOneField,
|
||||
models.OneToOneField,
|
||||
}
|
||||
|
||||
FLAG_PROPERTIES = (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue