diff --git a/README.rst b/README.rst index c0aac2d..a6904e6 100644 --- a/README.rst +++ b/README.rst @@ -5,6 +5,9 @@ django-eav Introduction ------------ +This is a fork of https://github.com/mvpdev/django-eav, to make it Python 3 compatible. + + django-eav provides an Entity-Attribute-Value storage model for django apps. For a decent explanation of what an Entity-Attribute-Value storage model is, diff --git a/eav/__init__.py b/eav/__init__.py index 73a21be..e4cc249 100644 --- a/eav/__init__.py +++ b/eav/__init__.py @@ -27,9 +27,9 @@ def get_version(): __version__ = get_version() def register(model_cls, config_cls=None): - from registry import Registry + from .registry import Registry Registry.register(model_cls, config_cls) def unregister(model_cls): - from registry import Registry + from .registry import Registry Registry.unregister(model_cls) diff --git a/eav/models.py b/eav/models.py index 9de7ab2..1544567 100644 --- a/eav/models.py +++ b/eav/models.py @@ -491,7 +491,7 @@ def validate_attributes(self): else: try: attribute.validate_value(value) - except ValidationError, e: + except ValidationError as e: raise ValidationError(_(u"%(attr)s EAV field %(err)s") % \ {'attr': attribute.slug, 'err': e}) diff --git a/eav/validators.py b/eav/validators.py index f5d6c5a..f3276ca 100644 --- a/eav/validators.py +++ b/eav/validators.py @@ -45,7 +45,7 @@ def validate_text(value): ''' Raises ``ValidationError`` unless *value* type is ``str`` or ``unicode`` ''' - if not (type(value) == unicode or type(value) == str): + if not (type(value) == str): raise ValidationError(_(u"Must be str or unicode")) diff --git a/setup.py b/setup.py index b4727b7..d029683 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ 'Django app.', long_description=open('README.rst').read(), - url='http://github.com/mvpdev/django-eav', + url='http://github.com/ckingswood/django-eav', packages=['eav', 'eav.tests'],