mirror of
https://github.com/jazzband/django-eav2.git
synced 2026-03-16 22:40:26 +00:00
style: explicitly define import path
This commit is contained in:
parent
065de53ba4
commit
5b9e5f2615
10 changed files with 16 additions and 21 deletions
|
|
@ -1,10 +1,10 @@
|
|||
def register(model_cls, config_cls=None):
|
||||
from .registry import Registry
|
||||
from eav.registry import Registry
|
||||
|
||||
Registry.register(model_cls, config_cls)
|
||||
|
||||
|
||||
def unregister(model_cls):
|
||||
from .registry import Registry
|
||||
from eav.registry import Registry
|
||||
|
||||
Registry.unregister(model_cls)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from django.contrib.admin.options import InlineModelAdmin, ModelAdmin
|
|||
from django.forms.models import BaseInlineFormSet
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from .models import Attribute, EnumGroup, EnumValue, Value
|
||||
from eav.models import Attribute, EnumGroup, EnumValue, Value
|
||||
|
||||
|
||||
class BaseEntityAdmin(ModelAdmin):
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ def register_eav(**kwargs):
|
|||
"""
|
||||
from django.db.models import Model
|
||||
|
||||
from . import register
|
||||
from eav import register
|
||||
|
||||
def _model_eav_wrapper(model_class):
|
||||
if not issubclass(model_class, Model):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from django.core.exceptions import ValidationError
|
|||
from django.db import models
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .forms import CSVFormField
|
||||
from eav.forms import CSVFormField
|
||||
|
||||
|
||||
class EavSlugField(models.SlugField):
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ try:
|
|||
except:
|
||||
JSONField = CharField
|
||||
|
||||
from .widgets import CSVWidget
|
||||
from eav.widgets import CSVWidget
|
||||
|
||||
|
||||
class CSVFormField(forms.Field):
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ This module contains the custom manager used by entities registered with eav.
|
|||
|
||||
from django.db import models
|
||||
|
||||
from .queryset import EavQuerySet
|
||||
from eav.queryset import EavQuerySet
|
||||
|
||||
|
||||
class EntityManager(models.Manager):
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ try:
|
|||
except ImportError:
|
||||
from django_jsonfield_backport.models import JSONField
|
||||
|
||||
from . import register
|
||||
from .exceptions import IllegalAssignmentException
|
||||
from .fields import CSVField, EavDatatypeField, EavSlugField
|
||||
from .validators import (
|
||||
from eav import register
|
||||
from eav.exceptions import IllegalAssignmentException
|
||||
from eav.fields import CSVField, EavDatatypeField, EavSlugField
|
||||
from eav.validators import (
|
||||
validate_bool,
|
||||
validate_csv,
|
||||
validate_date,
|
||||
|
|
|
|||
|
|
@ -22,17 +22,12 @@ Q-expressions need to be rewritten for two reasons:
|
|||
from functools import wraps
|
||||
from itertools import count
|
||||
|
||||
from django.core.exceptions import (
|
||||
FieldDoesNotExist,
|
||||
FieldError,
|
||||
ObjectDoesNotExist,
|
||||
)
|
||||
from django.db import models
|
||||
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
|
||||
from django.db.models import Case, IntegerField, Q, When
|
||||
from django.db.models.query import QuerySet
|
||||
from django.db.utils import NotSupportedError
|
||||
|
||||
from .models import Attribute, EnumValue, Value
|
||||
from eav.models import Attribute, EnumValue, Value
|
||||
|
||||
|
||||
def is_eav_and_leaf(expr, gr_name):
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
from django.contrib.contenttypes import fields as generic
|
||||
from django.db.models.signals import post_init, post_save, pre_save
|
||||
|
||||
from .managers import EntityManager
|
||||
from .models import Attribute, Entity, Value
|
||||
from eav.managers import EntityManager
|
||||
from eav.models import Attribute, Entity, Value
|
||||
|
||||
|
||||
class EavConfig(object):
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ def validate_enum(value):
|
|||
Raises ``ValidationError`` unless *value* is a saved
|
||||
:class:`~eav.models.EnumValue` model instance.
|
||||
"""
|
||||
from .models import EnumValue
|
||||
from eav.models import EnumValue
|
||||
|
||||
if isinstance(value, EnumValue) and not value.pk:
|
||||
raise ValidationError(_(u"EnumValue has not been saved yet"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue