mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Ensure PartParameterTemplate name is unique
This commit is contained in:
parent
6752bdc1c6
commit
13270617b9
2
.gitignore
vendored
2
.gitignore
vendored
@ -34,6 +34,8 @@ docs/_build
|
|||||||
# Local static and media file storage (only when running in development mode)
|
# Local static and media file storage (only when running in development mode)
|
||||||
InvenTree/media
|
InvenTree/media
|
||||||
InvenTree/static
|
InvenTree/static
|
||||||
|
media
|
||||||
|
static
|
||||||
|
|
||||||
# Local config file
|
# Local config file
|
||||||
config.yaml
|
config.yaml
|
||||||
|
18
InvenTree/part/migrations/0018_auto_20190907_0941.py
Normal file
18
InvenTree/part/migrations/0018_auto_20190907_0941.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.2.4 on 2019-09-07 09:41
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('part', '0017_bomitem_checksum'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='partparametertemplate',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(help_text='Parameter Name', max_length=100, unique=True),
|
||||||
|
),
|
||||||
|
]
|
@ -1068,7 +1068,7 @@ class PartParameterTemplate(models.Model):
|
|||||||
""" Return the number of instances of this Parameter Template """
|
""" Return the number of instances of this Parameter Template """
|
||||||
return self.instances.count()
|
return self.instances.count()
|
||||||
|
|
||||||
name = models.CharField(max_length=100, help_text='Parameter Name')
|
name = models.CharField(max_length=100, help_text='Parameter Name', unique=True)
|
||||||
|
|
||||||
units = models.CharField(max_length=25, help_text='Parameter Units', blank=True)
|
units = models.CharField(max_length=25, help_text='Parameter Units', blank=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user