mirror of
https://github.com/jazzband/django-eav2.git
synced 2026-03-20 00:10:24 +00:00
Added EavAttributeLabel model
This commit is contained in:
parent
b59c5b60bb
commit
d7ba2ee4f0
1 changed files with 10 additions and 2 deletions
12
models.py
12
models.py
|
|
@ -1,11 +1,16 @@
|
|||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.contenttypes import generic
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .fields import UuidField
|
||||
|
||||
|
||||
class EavAttributeLabel(models.Model):
|
||||
name = models.CharField(_(u"name"), db_index=True,
|
||||
unique=True, max_length=100)
|
||||
|
||||
|
||||
class EavAttribute(models.Model):
|
||||
'''
|
||||
The A model in E-A-V. This holds the 'concepts' along with the data type
|
||||
|
|
@ -47,7 +52,10 @@ class EavAttribute(models.Model):
|
|||
datatype = models.CharField(_(u"data type"), max_length=6,
|
||||
choices=DATATYPE_CHOICES)
|
||||
|
||||
uuid = UuidField(auto=True)
|
||||
uuid = UuidField(_(u"UUID"), auto=True)
|
||||
|
||||
labels = models.ManyToManyField(EavAttributeLabel,
|
||||
verbose_name=_(u"labels"))
|
||||
|
||||
def get_value_for_entity(self, entity):
|
||||
'''
|
||||
|
|
|
|||
Loading…
Reference in a new issue