# Generated by Django 3.2.4 on 2021-07-08 11:06

import django.core.validators
from django.db import migrations, models
import label.models


class Migration(migrations.Migration):

    dependencies = [
        ('label', '0007_auto_20210513_1327'),
    ]

    operations = [
        migrations.CreateModel(
            name='PartLabel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Label name', max_length=100, verbose_name='Name')),
                ('description', models.CharField(blank=True, help_text='Label description', max_length=250, null=True, verbose_name='Description')),
                ('label', models.FileField(help_text='Label template file', unique=True, upload_to=label.models.rename_label, validators=[django.core.validators.FileExtensionValidator(allowed_extensions=['html'])], verbose_name='Label')),
                ('enabled', models.BooleanField(default=True, help_text='Label template is enabled', verbose_name='Enabled')),
                ('width', models.FloatField(default=50, help_text='Label width, specified in mm', validators=[django.core.validators.MinValueValidator(2)], verbose_name='Width [mm]')),
                ('height', models.FloatField(default=20, help_text='Label height, specified in mm', validators=[django.core.validators.MinValueValidator(2)], verbose_name='Height [mm]')),
                ('filename_pattern', models.CharField(default='label.pdf', help_text='Pattern for generating label filenames', max_length=100, verbose_name='Filename Pattern')),
                ('filters', models.CharField(blank=True, help_text='Part query filters (comma-separated value of key=value pairs)', max_length=250, validators=[label.models.validate_part_filters], verbose_name='Filters')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterField(
            model_name='stockitemlabel',
            name='filters',
            field=models.CharField(blank=True, help_text='Query filters (comma-separated list of key=value pairs),', max_length=250, validators=[label.models.validate_stock_item_filters], verbose_name='Filters'),
        ),
    ]
