Django EAV 2 - EAV storage for modern Django
Find a file
dependabot[bot] 0446a19040
chore(deps): bump django from 5.2.18 to 5.2.19
Bumps [django](https://github.com/django/django) from 5.2.18 to 5.2.19.
- [Commits](https://github.com/django/django/compare/5.2.18...5.2.19)

---
updated-dependencies:
- dependency-name: django
  dependency-version: 5.2.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-11-11 02:07:46 +00:00
.github ci: add Codecov configuration 2026-11-02 09:40:00 -07:00
docs chore: clean up package metadata and branding 2026-10-24 18:54:40 -07:00
eav fix: allow assigning EAV attributes on Entity during type checking 2026-10-22 11:01:51 -07:00
test_project fix!: honor EAV2_PRIMARY_KEY_FIELD in migrations and drop CharField support 2026-10-14 16:13:23 -07:00
tests fix: allow assigning EAV attributes on Entity during type checking 2026-10-22 11:01:51 -07:00
.editorconfig update links (#275) 2022-11-16 01:53:47 +02:00
.git-blame-ignore-revs chore: add .git-blame-ignore-revs file 2024-09-01 14:57:47 -07:00
.gitignore fix: ship the Indonesian translation and check the compiled catalogs 2026-10-14 16:48:45 -07:00
.importlinter fix: filter on attributes with EXISTS subqueries 2026-10-16 07:27:18 -07:00
.pre-commit-config.yaml [pre-commit.ci] pre-commit autoupdate 2026-10-23 08:48:46 -07:00
.readthedocs.yml ci: pin actions, add postgres, mysql, docs and package jobs 2026-10-14 10:20:00 -07:00
CHANGELOG.md chore: release 2.0.2 2026-10-30 12:00:36 -07:00
CODE_OF_CONDUCT.md docs: move project links to django-commons 2026-10-24 15:40:26 -07:00
CONTRIBUTING.md docs: move project links to django-commons 2026-10-24 15:40:26 -07:00
CONTRIBUTORS.md fix: allow assigning EAV attributes on Entity during type checking 2026-10-22 11:01:51 -07:00
docker-compose.yml ci: pin actions, add postgres, mysql, docs and package jobs 2026-10-14 10:20:00 -07:00
LICENSE update links (#275) 2022-11-16 01:53:47 +02:00
manage.py refactor: move non-circular deferred imports to top-level, noqa circular ones 2026-05-22 16:26:04 -07:00
pyproject.toml chore: release 2.0.2 2026-10-30 12:00:36 -07:00
README.md chore: clean up package metadata and branding 2026-10-24 18:54:40 -07:00
setup.cfg build: drop the mypy, pyright and WPS baselines 2026-10-15 07:36:18 -07:00
uv.lock chore(deps): bump django from 5.2.18 to 5.2.19 2026-11-11 02:07:46 +00:00

Build Status codecov Python Version Django Version

Django EAV 2

Django EAV 2 stores extra, typed attributes for your Django models without changing their tables. Define an attribute once, then read, write, and filter it on any registered model as if it were a field. Administrators can add and change attributes at runtime, in the Django admin or in code, without a migration.

It is a fork of django-eav, which was itself derived from eav-django.

Read the documentation at https://django-eav2.readthedocs.io.

Install

pip install django-eav2

Add eav to INSTALLED_APPS, then run python manage.py migrate:

INSTALLED_APPS = [
    # ...
    "eav",
]

The package's tables use BigAutoField primary keys. To use UUIDs, set EAV2_PRIMARY_KEY_FIELD = "django.db.models.UUIDField" before the first migrate. See the configuration docs.

Quick start

Register a model, create an attribute, then store and query values:

import eav
from django.db import models
from eav.models import Attribute


class Supplier(models.Model):
    name = models.CharField(max_length=100)


eav.register(Supplier)

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

supplier = Supplier.objects.create(name="Acme", eav__city="London")
supplier.eav.city  # "London"

Supplier.objects.filter(eav__city="London")

Is EAV right for you?

EAV trades query speed and simplicity for flexibility. It suits open-ended, sparse, or user-defined properties, and is a poor fit for stable, known columns or performance-critical reporting. The concepts page explains the model, when to use it, when to avoid it, and the alternatives.

Contributing

See CONTRIBUTING.md. The project is part of Django Commons, and follows its code of conduct.