Django EAV 2 - EAV storage for modern Django
Find a file
2018-08-10 08:19:37 +00:00
.github/ISSUE_TEMPLATE Update issue templates 2018-08-03 12:23:52 +00:00
docs Rewrite documentation for modern Sphinx (#5) 2018-07-23 16:27:12 +00:00
eav patch migration, made tox check for missing migrations (#35) 2018-08-02 11:16:44 +02:00
tests Add form test involving enums 2018-08-10 08:19:37 +00:00
.coveragerc Move remaining docstrings to Google-stype format (#10) 2018-07-27 13:23:57 +00:00
.gitignore Add registration via metaclass (#23) 2018-07-27 14:01:38 +00:00
.travis.yml Fix tests for Django 2.1+ (tip) (#25) 2018-07-27 13:47:01 +02:00
CONTRIBUTING.md Add contributing guidelines 2018-08-03 13:09:56 +00:00
CONTRIBUTORS.md Add John to contributors 2018-08-02 09:18:48 +00:00
LICENSE Move license notice to root directory (#3) 2018-05-18 13:37:39 +02:00
MANIFEST.in Exclude package "tests" from distribution (#32) 2018-08-03 13:46:08 +00:00
PULL_REQUEST_TEMPLATE.md Create PULL_REQUEST_TEMPLATE.md 2018-08-03 12:12:19 +00:00
README.md Rewrite documentation for modern Sphinx (#5) 2018-07-23 16:27:12 +00:00
requirements.txt Update TravisCI config to use Tox 2018-06-15 09:50:46 +02:00
runtests Add tests for forms 2018-07-13 11:54:57 +00:00
setup.py Use find_packages in setuptools (#33) 2018-08-01 07:22:12 +00:00
tox.ini patch migration, made tox check for missing migrations (#35) 2018-08-02 11:16:44 +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.