@ -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 %'
|
||||
|
||||
|
Reference in New Issue
Block a user