You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this field in my Product Model: translations = TranslatedFields( name=models.CharField( max_length=256, unique=True, verbose_name=_('Name'), help_text=_("Enter a descriptive name for your product. This will be its title in your store.")), )
with unique=True
When I try to add the name qwerty to this object in english et french,
django.db.utils.IntegrityError: duplicate key value violates unique constraint "product_product_translation_me_c1a12fbb_uniq" DETAIL: Key (name)=(qwerty) already exists.
But unique should be unique by product object, not unique by object and translations.
Many thanks for you help
The text was updated successfully, but these errors were encountered:
Hello
I have this field in my Product Model:
translations = TranslatedFields( name=models.CharField( max_length=256, unique=True, verbose_name=_('Name'), help_text=_("Enter a descriptive name for your product. This will be its title in your store.")), )
with unique=True
When I try to add the name qwerty to this object in english et french,
translations: {"en":{"name":"qwerty"},"fr":{"name":"qwerty"}}
I got this error:
django.db.utils.IntegrityError: duplicate key value violates unique constraint "product_product_translation_me_c1a12fbb_uniq" DETAIL: Key (name)=(qwerty) already exists.
But unique should be unique by product object, not unique by object and translations.
Many thanks for you help
The text was updated successfully, but these errors were encountered: