Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 compatible #24

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions eav/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion eav/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion eav/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],

Expand Down