From 4908259fadf3de835b80e6dadddf7ef4261bf98c Mon Sep 17 00:00:00 2001 From: RogerWork Date: Fri, 27 Mar 2026 18:04:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=A1=B5=E9=9D=A2=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=BA=A7=E5=93=81=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product/migrations/0005_prditem_prd_status.py | 18 ++++++++++++++++++ product/models.py | 11 +++++++++++ product/serializers.py | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 product/migrations/0005_prditem_prd_status.py diff --git a/product/migrations/0005_prditem_prd_status.py b/product/migrations/0005_prditem_prd_status.py new file mode 100644 index 0000000..6fe4e82 --- /dev/null +++ b/product/migrations/0005_prditem_prd_status.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.7 on 2026-03-27 09:57 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('product', '0004_prditem_have_history'), + ] + + operations = [ + migrations.AddField( + model_name='prditem', + name='prd_status', + field=models.CharField(default='立项', help_text='版本状态', max_length=200, verbose_name='版本状态'), + ), + ] diff --git a/product/models.py b/product/models.py index de41ee6..16a8fef 100644 --- a/product/models.py +++ b/product/models.py @@ -1,5 +1,15 @@ from django.db import models +# class ProjectStatus(models.TextChoices): +# KICKOUT = 'KICKOUT','立项' +# DESIGN = 'DESIGN', '产品设计' +# DEV = 'DEV', '开发中' +# TEST = 'TEST', '测试中' +# FINISH = 'FINISH', '结测待上线' +# ONLINE = 'ONLINE', '已上线' +# PAUSE = 'PAUSE', '暂停' +# END = 'END', '终止' + # Create your models here. class Project(models.Model): id = models.AutoField(primary_key=True) @@ -19,6 +29,7 @@ class PrdItem(models.Model): id = models.AutoField(primary_key=True) project = models.CharField(verbose_name='所属项目',max_length=100, help_text='所属项目') prd_version = models.CharField(verbose_name='版本',max_length=200, help_text='版本') + prd_status = models.CharField(verbose_name='版本状态',max_length=200, default='立项', help_text='版本状态') prd_doc_link = models.CharField(verbose_name='原型地址',max_length=100, help_text='原型地址') prd_comment = models.TextField(verbose_name='版本描述', help_text='版本描述') have_history = models.BooleanField(verbose_name='包含历史版本', default=False, help_text='包含历史版本') diff --git a/product/serializers.py b/product/serializers.py index 3ef3f72..6fb9a62 100644 --- a/product/serializers.py +++ b/product/serializers.py @@ -13,7 +13,7 @@ class ProjectSerializer(serializers.ModelSerializer): class PrdItemSerializer(serializers.ModelSerializer): class Meta: model = PrdItem - fields = ('id', 'project', 'prd_version', 'prd_doc_link', 'prd_comment', 'have_history', 'is_delete', 'update_at') + fields = ('id', 'project', 'prd_version', 'prd_status', 'prd_doc_link', 'prd_comment', 'have_history', 'is_delete', 'update_at') def to_representation(self, instance): rep = super().to_representation(instance)