Django EAV 2 - EAV storage for modern Django
Find a file
2018-07-13 09:02:43 +00:00
docs More spelling corrections 2010-09-29 13:25:41 +03:00
eav Clean up code a bit; work on code-style 2018-07-13 09:02:43 +00:00
tests Clean up code a bit; work on code-style 2018-07-13 09:02:43 +00:00
.coveragerc Configure coverage's ignored files 2018-06-14 16:15:36 +02:00
.gitignore Update gitignore 2018-06-20 10:52:20 +02:00
.travis.yml Update TravisCI config to use Tox 2018-06-15 09:50:46 +02:00
CONTRIBUTORS.md Add contributors list 2018-06-03 16:01:47 +02:00
LICENSE Move license notice to root directory (#3) 2018-05-18 13:37:39 +02:00
README.md Update README.md 2018-07-11 11:18:07 +00:00
requirements.txt Update TravisCI config to use Tox 2018-06-15 09:50:46 +02:00
runtests Remove Sites framework dependency (#9) (#15) 2018-06-04 17:19:05 +02:00
setup.py Update Developement Status 2018-06-20 09:43:18 +02:00
tox.ini Setup tox (#16) 2018-06-14 16:15:36 +02:00

Build Status Coverage Status Codacy Badge Maintainability Python Version Django Version

Django EAV 2 - Entity-Attribute-Value storage for Django

Django EAV 2 is a fork of django-eav (which itself was derived from eav-django). You can find documentation here.

Installation

You can install django-eav2 from three sources:

# From PyPI via pip
pip install django-eav2

# From source via pip
pip install git+https://github.com/makimo/django-eav2@master

# From source via setuptools
git clone git@github.com:makimo/django-eav2.git
cd django-eav2
python setup.py install

# To uninstall:
python setup.py install --record files.txt
rm $(cat files.txt)

Getting started

Step 1. Register a model:

import eav
eav.register(Supplier)

or with decorators:

from eav.decorators import register_eav

@register_eav
class Supplier(models.Model):
    ...

Step 2. Create an attribute:

Attribute.objects.create(name='City', datatype=Attribute.TYPE_TEXT)

Step 3. Thats it! Youre ready to go:

supplier.eav.city = 'London'
supplier.save()

Supplier.objects.filter(eav__city='London')
# = <EavQuerySet [<Supplier: Supplier object (1)>]>

What next? Check out documentation.