Simplified imports from django.db and django.contrib.gis.db.

This commit is contained in:
Nick Pope 2019-08-20 08:54:41 +01:00 committed by Mariusz Felisiak
parent 469bf2db15
commit 335c9c94ac
113 changed files with 382 additions and 450 deletions

View file

@ -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 = (