Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9a56b8a
Add ContentType and extra field types to Attribute
mtahirtariq Jul 27, 2020
cfdd8ad
Fix enum_multi field
mtahirtariq Aug 12, 2020
c031016
Fix enum multi validation.
ragdubizzle Aug 17, 2020
cbc5928
Add custom update method
Aug 19, 2020
fcaccb1
Fix multi_enum field save
mtahirtariq Sep 6, 2020
83e736e
Merge pull request #2 from dubizzle/add-custom-update
mtahirtariq Sep 9, 2020
f55f918
Merge pull request #1 from dubizzle/attribute-contenttype
mtahirtariq Sep 9, 2020
9e0b359
Fix EavQuerySet.update method to handle all records in queryset
mtahirtariq Sep 13, 2020
36711e0
Merge pull request #3 from dubizzle/qs-update-fix
mtahirtariq Sep 13, 2020
074e0b8
Add multiple optimization to reduce the load on database
mtahirtariq Sep 20, 2020
34cc9df
Merge pull request #5 from dubizzle/optimizations-v1
mtahirtariq Sep 20, 2020
93069b7
Remove validation while saving eav.Value in favour of database level …
mtahirtariq Oct 7, 2020
417ceeb
Merge pull request #6 from dubizzle/optimize-value-save
alikazi Oct 7, 2020
e095e0e
Add json support in eav.
ragdubizzle Nov 18, 2020
eb748cf
Fix validation.
ragdubizzle Nov 18, 2020
aa6f925
Merge pull request #7 from dubizzle/json-support
Nov 25, 2020
0986575
changed imports ugetext_lazy to gettext_lazy to make it compatible wi…
AnasAhmed1997 Jun 24, 2024
257cd62
changed NullBoolean field to Boolean(null=True).
AnasAhmed1997 Jun 27, 2024
ae06c96
Merge pull request #9 from dubizzle/support-django-4.X.X
AnasAhmed1997 Jul 9, 2024
9e49a84
Fix Value repr crash for missing entity
alishba-javed-2001 Jun 3, 2025
6ba4a20
Fix Value repr crash for missing entity
alishba-javed-2001 Jun 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eav/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class EavSlugField(models.SlugField):
Expand Down
2 changes: 1 addition & 1 deletion eav/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from django.contrib.admin.widgets import AdminSplitDateTime
from django.forms import (BooleanField, CharField, ChoiceField, DateTimeField,
FloatField, IntegerField, ModelForm)
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import gettext_lazy as _


class BaseDynamicEntityForm(ModelForm):
Expand Down
2 changes: 1 addition & 1 deletion eav/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Migration(migrations.Migration):
('value_float', models.FloatField(blank=True, null=True)),
('value_int', models.IntegerField(blank=True, null=True)),
('value_date', models.DateTimeField(blank=True, null=True)),
('value_bool', models.NullBooleanField()),
('value_bool', models.BooleanField(null=True)),
('generic_value_id', models.IntegerField(blank=True, null=True)),
('created', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Created')),
('modified', models.DateTimeField(auto_now=True, verbose_name='Modified')),
Expand Down
64 changes: 64 additions & 0 deletions eav/migrations/0002_add_new_fields.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Generated by Django 3.0.2 on 2020-07-27 07:30

from django.db import migrations, models
import django.db.models.deletion
import eav.fields


class Migration(migrations.Migration):

dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('eav', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='attribute',
name='entity_ct',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='attribute_entities', to='contenttypes.ContentType'),
),
migrations.AddField(
model_name='attribute',
name='entity_id',
field=models.UUIDField(blank=True, null=True),
),
migrations.AddField(
model_name='enumvalue',
name='legacy_value',
field=models.CharField(blank=True, db_index=True, max_length=100, null=True, verbose_name='Legacy Value'),
),
migrations.AddField(
model_name='value',
name='value_decimal',
field=models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True),
),
migrations.AddField(
model_name='value',
name='value_enum_multi',
field=models.ManyToManyField(related_name='eav_multi_values', to='eav.EnumValue'),
),
migrations.AlterField(
model_name='attribute',
name='datatype',
field=eav.fields.EavDatatypeField(
choices=[('text', 'Text'), ('date', 'Date'), ('float', 'Float'), ('decimal', 'Decimal'),
('int', 'Integer'), ('bool', 'True / False'), ('object', 'Django Object'), ('enum', 'Choice'),
('enum_multi', 'Multiple Choice')], max_length=10, verbose_name='Data Type'),
),
migrations.AlterField(
model_name='attribute',
name='slug',
field=eav.fields.EavSlugField(help_text='Short attribute label', verbose_name='Slug'),
),
migrations.AlterField(
model_name='enumgroup',
name='name',
field=models.CharField(max_length=100, verbose_name='Name'),
),
migrations.AlterField(
model_name='enumvalue',
name='value',
field=models.CharField(db_index=True, max_length=100, verbose_name='Value'),
),
]
18 changes: 18 additions & 0 deletions eav/migrations/0003_add_values_unique_constraint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.0.2 on 2020-09-20 11:05

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('eav', '0002_add_new_fields'),
]

operations = [
migrations.AlterUniqueTogether(
name='value',
unique_together={('entity_ct', 'entity_id', 'attribute_id')},
),
]
Loading