feat(project_management): Add manager and users for projects and tasks

!30 #14
This commit is contained in:
2024-06-18 08:37:54 +09:30
parent 9bc4f186d5
commit 3c206f5aef
5 changed files with 122 additions and 1 deletions

View File

@ -1,5 +1,8 @@
from django.contrib.auth.models import User
from django.db import models
from access.models import Team
from core.mixin.history_save import SaveHistory
from .project_common import ProjectCommonFieldsName
@ -35,7 +38,6 @@ class Project(ProjectCommonFieldsName, SaveHistory):
# state
# project_type
code = models.CharField(
@ -73,8 +75,30 @@ class Project(ProjectCommonFieldsName, SaveHistory):
verbose_name = 'Real Finish Date',
)
manager_user = models.ForeignKey(
User,
blank= True,
help_text = '',
on_delete=models.SET_NULL,
null = True,
related_name = 'manager_user'
)
manager_team = models.ForeignKey(
Team,
blank= True,
help_text = '',
on_delete=models.SET_NULL,
null = True,
)
model_notes = None
team_members = models.ManyToManyField(
to = User,
blank = True,
)
@property
def percent_completed(self) -> str: # Auto-Calculate