feat: make Currency name unique

This commit is contained in:
Herculino Trotta
2024-10-14 11:06:55 -03:00
parent 212ee2bf28
commit a645252ace
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ from django.utils.translation import gettext_lazy as _
class Currency(models.Model):
code = models.CharField(max_length=10, unique=True, verbose_name=_("Currency Code"))
name = models.CharField(max_length=50, verbose_name=_("Currency Name"))
name = models.CharField(max_length=50, verbose_name=_("Currency Name"), unique=True)
decimal_places = models.PositiveIntegerField(
default=2,
validators=[MaxValueValidator(30), MinValueValidator(0)],