mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 03:56:43 +00:00
Add description field
This commit is contained in:
parent
02e71bd2ce
commit
098cd0ec44
23
InvenTree/common/migrations/0005_auto_20190915_1256.py
Normal file
23
InvenTree/common/migrations/0005_auto_20190915_1256.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 2.2.5 on 2019-09-15 12:56
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('common', '0004_inventreesetting'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='inventreesetting',
|
||||||
|
name='description',
|
||||||
|
field=models.CharField(blank=True, help_text='Settings description', max_length=200),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='inventreesetting',
|
||||||
|
name='key',
|
||||||
|
field=models.CharField(help_text='Settings key (must be unique - case insensitive', max_length=50, unique=True),
|
||||||
|
),
|
||||||
|
]
|
@ -62,10 +62,12 @@ class InvenTreeSetting(models.Model):
|
|||||||
setting.value = value
|
setting.value = value
|
||||||
setting.save()
|
setting.save()
|
||||||
|
|
||||||
key = models.CharField(max_length=50, blank=False, unique=True, help_text=_('Settings key'))
|
key = models.CharField(max_length=50, blank=False, unique=True, help_text=_('Settings key (must be unique - case insensitive'))
|
||||||
|
|
||||||
value = models.CharField(max_length=200, blank=True, unique=False, help_text=_('Settings value'))
|
value = models.CharField(max_length=200, blank=True, unique=False, help_text=_('Settings value'))
|
||||||
|
|
||||||
|
description = models.CharField(max_length=200, blank=True, unique=False, help_text=_('Settings description'))
|
||||||
|
|
||||||
def validate_unique(self, exclude=None):
|
def validate_unique(self, exclude=None):
|
||||||
""" Ensure that the key:value pair is unique.
|
""" Ensure that the key:value pair is unique.
|
||||||
In addition to the base validators, this ensures that the 'key'
|
In addition to the base validators, this ensures that the 'key'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user