mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
* 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
23 lines
840 B
Python
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')),
|
|
],
|
|
),
|
|
]
|