From 80fd2090ad9f897b73de32cee1d5987e1bd7640a Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 12 Dec 2024 11:10:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A5=E6=AE=B5=E6=B7=BB=E5=8A=A0cod?= =?UTF-8?q?e=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/mtm/filters.py | 1 + apps/mtm/migrations/0044_mgroup_code.py | 18 ++++++++++++++++++ apps/mtm/models.py | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 apps/mtm/migrations/0044_mgroup_code.py diff --git a/apps/mtm/filters.py b/apps/mtm/filters.py index c36c4568..7724936d 100644 --- a/apps/mtm/filters.py +++ b/apps/mtm/filters.py @@ -11,6 +11,7 @@ class MaterialFilter(filters.FilterSet): fields = { "id": ["exact", "in"], "cate": ["exact", "in"], + "code": ["exact", "in", "isnull"], "type": ["exact", "in"], "is_hidden": ["exact"], "is_assemb": ["exact"], diff --git a/apps/mtm/migrations/0044_mgroup_code.py b/apps/mtm/migrations/0044_mgroup_code.py new file mode 100644 index 00000000..152f3680 --- /dev/null +++ b/apps/mtm/migrations/0044_mgroup_code.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2024-12-12 03:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('mtm', '0043_srule'), + ] + + operations = [ + migrations.AddField( + model_name='mgroup', + name='code', + field=models.CharField(blank=True, max_length=50, null=True, verbose_name='标识'), + ), + ] diff --git a/apps/mtm/models.py b/apps/mtm/models.py index dd358c4e..dc8649bb 100644 --- a/apps/mtm/models.py +++ b/apps/mtm/models.py @@ -118,7 +118,7 @@ class Mgroup(CommonBModel): """ name = models.CharField('名称', max_length=50) - # code = models.CharField('标识', max_length=50, null=True, blank=True) + code = models.CharField('标识', max_length=50, null=True, blank=True) cate = models.CharField( '分类', max_length=50, default='section', help_text='section/other') # section是工段 shift_rule = models.CharField('班次规则', max_length=10, default='默认')