feat(project_management): add project state field to project model

ref: #294 #298
This commit is contained in:
2024-09-17 12:49:53 +09:30
parent 1314f9a1ff
commit a4926f8a0d
3 changed files with 30 additions and 1 deletions

View File

@ -43,6 +43,7 @@ class ProjectSerializer(
fields = [
'id',
'state',
'name',
'description',
'code',

View File

@ -0,0 +1,19 @@
# Generated by Django 5.0.8 on 2024-09-17 03:18
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('project_management', '0003_alter_project_external_system_projectstate_and_more'),
]
operations = [
migrations.AlterField(
model_name='project',
name='state',
field=models.ForeignKey(help_text='Staate of the project', null=True, on_delete=django.db.models.deletion.SET_NULL, to='project_management.projectstate', verbose_name='Project State'),
),
]

View File

@ -7,6 +7,7 @@ from core.mixin.history_save import SaveHistory
from core.models.ticket.ticket_enum_values import TicketValues
from .project_common import ProjectCommonFieldsName
from .project_states import ProjectState
class Project(ProjectCommonFieldsName):
@ -70,7 +71,15 @@ class Project(ProjectCommonFieldsName):
# priority
# state
state = models.ForeignKey(
ProjectState,
blank= False,
help_text = 'Staate of the project',
on_delete=models.SET_NULL,
null = True,
verbose_name ='Project State'
)
# project_type