InvenTree/InvenTree/common/migrations/0020_customunit.py
Oliver 6d3978ea28
Add database model for defining custom units (#5268)
* Add database model for defining custom units

- Database model
- DRF serializer
- API endpoints

* Add validation hook

* Custom check for the 'definition' field

* Add settings page for custom units

- Table of units
- Create / edit / delete buttons

* Allow "unit" field to be empty

- Not actually required for custom unit definition

* Load custom unit definitions into global registry

* Docs: add core concepts page(s)

* Add some back links

* Update docs

* Add unit test for custom unit conversion

* More unit testing

* remove print statements

* Add missing table rule
2023-07-19 06:24:16 +10:00

23 lines
840 B
Python

# Generated by Django 3.2.20 on 2023-07-18 11:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('common', '0019_projectcode_metadata'),
]
operations = [
migrations.CreateModel(
name='CustomUnit',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(help_text='Unit name', max_length=50, unique=True, verbose_name='Name')),
('symbol', models.CharField(blank=True, help_text='Optional unit symbol', max_length=10, unique=True, verbose_name='Symbol')),
('definition', models.CharField(help_text='Unit definition', max_length=50, verbose_name='Definition')),
],
),
]