mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-28 12:12:02 +01:00
feat: make Currency name unique
This commit is contained in:
20
app/apps/currencies/migrations/0005_alter_currency_name.py
Normal file
20
app/apps/currencies/migrations/0005_alter_currency_name.py
Normal file
@@ -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):
|
||||
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)],
|
||||
|
||||
Reference in New Issue
Block a user