feat(project_management): add interim project model

!30
This commit is contained in:
2024-06-18 04:16:51 +09:30
parent dcba456af3
commit 5f3a778002
3 changed files with 139 additions and 23 deletions

View File

@ -1,9 +1,9 @@
from django.db import models
from access.models import TenancyObject
from .project_common import ProjectCommonFieldsName
class ProjectModel(TenancyObject):
class Project(ProjectCommonFieldsName):
class Meta:
@ -18,30 +18,69 @@ class ProjectModel(TenancyObject):
verbose_name_plural = 'Projects'
class ProjectStates(enum):
OPEN = 1
CLOSED = 1
# class ProjectStates(enum):
# OPEN = 1
# CLOSED = 1
name
description = models.TextField(
blank = True,
default = None,
null= True,
)
description
# priority
priority
state
percent_done # Auto-Calculate
project_type
code
planned_start_date
planned_finish_date
real_start_date
# state
# project_type
code = models.CharField(
blank = False,
help_text = 'Project Code',
max_length = 25,
unique = True,
)
planned_start_date = models.DateTimeField(
blank = True,
help_text = 'When the project is planned to have been started by.',
null = True,
verbose_name = 'Planned Start Date',
)
planned_finish_date = models.DateTimeField(
blank = True,
help_text = 'When the project is planned to be finished by.',
null = True,
verbose_name = 'Planned Finish Date',
)
real_start_date = models.DateTimeField(
blank = True,
help_text = 'When work commenced on the project.',
null = True,
verbose_name = 'Real Start Date',
)
real_finish_date = models.DateTimeField(
blank = True,
help_text = 'When work was completed for the project',
null = True,
verbose_name = 'Real Finish Date',
)
model_notes = None
@property
def percent_completed(self) -> str: # Auto-Calculate
""" How much of the project is completed.
Returns:
str: Calculated percentage of project completion.
"""
return 'xx %'