mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-14 08:42:45 +02:00
feat: make Currency name unique
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 5.1.1 on 2024-10-14 14:06
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("currencies", "0004_exchangerate"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="currency",
|
||||||
|
name="name",
|
||||||
|
field=models.CharField(
|
||||||
|
max_length=50, unique=True, verbose_name="Currency Name"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -5,7 +5,7 @@ from django.utils.translation import gettext_lazy as _
|
|||||||
|
|
||||||
class Currency(models.Model):
|
class Currency(models.Model):
|
||||||
code = models.CharField(max_length=10, unique=True, verbose_name=_("Currency Code"))
|
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(
|
decimal_places = models.PositiveIntegerField(
|
||||||
default=2,
|
default=2,
|
||||||
validators=[MaxValueValidator(30), MinValueValidator(0)],
|
validators=[MaxValueValidator(30), MinValueValidator(0)],
|
||||||
|
|||||||
Reference in New Issue
Block a user