Django Rest Framework & Entity–attribute–value model (EAV) Data Model
from django.db import models # django user from django.contrib.auth.models import User class Entity(models.Model): """ Entity of EAV """ entity = models.CharField(max_length=216, null=False, default='entity_name', name='entity', verbose_name='Entity of EAV', db_index=True, unique=True ) class Asset(models.Model): """ Asset of EAV """ asset = models.CharField(max_length=216, null=False, default='asset', name='asset', verbose_name='Asset of EAV' ) entity = models.ForeignKey(to=Entity) class Meta: unique_together = ("asset", "entity") class Value(models.Model): """ Value of EAV """ value = models