Skip to content

Commit

Permalink
feat(project_management): add field external system to projects
Browse files Browse the repository at this point in the history
ref: #292
  • Loading branch information
jon-nfc committed Sep 16, 2024
1 parent 383bca4 commit 033f47b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 5.0.8 on 2024-09-16 05:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('project_management', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='project',
name='external_ref',
field=models.IntegerField(blank=True, default=None, help_text='External System reference', null=True, verbose_name='Reference Number'),
),
migrations.AddField(
model_name='project',
name='external_system',
field=models.IntegerField(blank=True, choices=[], default=None, help_text='External system this item derives', null=True, verbose_name='External System'),
),
]
4 changes: 3 additions & 1 deletion app/project_management/models/project_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class Meta:
blank=False
)

created = AutoCreatedField()
created = AutoCreatedField(
editable = True,
)

modified = AutoLastModifiedField()

Expand Down
34 changes: 34 additions & 0 deletions app/project_management/models/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from access.models import Team

from core.mixin.history_save import SaveHistory
from core.models.ticket.ticket_enum_values import TicketValues

from .project_common import ProjectCommonFieldsName

Expand All @@ -23,10 +24,43 @@ class Meta:
verbose_name_plural = 'Projects'


class Ticket_ExternalSystem(models.IntegerChoices): # <null|github|gitlab>
GITHUB = TicketValues.ExternalSystem._GITHUB_INT, TicketValues.ExternalSystem._GITHUB_VALUE
GITLAB = TicketValues.ExternalSystem._GITLAB_INT, TicketValues.ExternalSystem._GITLAB_VALUE

CUSTOM_1 = TicketValues.ExternalSystem._CUSTOM_1_INT, TicketValues.ExternalSystem._CUSTOM_1_VALUE
CUSTOM_2 = TicketValues.ExternalSystem._CUSTOM_2_INT, TicketValues.ExternalSystem._CUSTOM_2_VALUE
CUSTOM_3 = TicketValues.ExternalSystem._CUSTOM_3_INT, TicketValues.ExternalSystem._CUSTOM_3_VALUE
CUSTOM_4 = TicketValues.ExternalSystem._CUSTOM_4_INT, TicketValues.ExternalSystem._CUSTOM_4_VALUE
CUSTOM_5 = TicketValues.ExternalSystem._CUSTOM_5_INT, TicketValues.ExternalSystem._CUSTOM_5_VALUE
CUSTOM_6 = TicketValues.ExternalSystem._CUSTOM_6_INT, TicketValues.ExternalSystem._CUSTOM_6_VALUE
CUSTOM_7 = TicketValues.ExternalSystem._CUSTOM_7_INT, TicketValues.ExternalSystem._CUSTOM_7_VALUE
CUSTOM_8 = TicketValues.ExternalSystem._CUSTOM_8_INT, TicketValues.ExternalSystem._CUSTOM_8_VALUE
CUSTOM_9 = TicketValues.ExternalSystem._CUSTOM_9_INT, TicketValues.ExternalSystem._CUSTOM_9_VALUE


# class ProjectStates(enum):
# OPEN = 1
# CLOSED = 1

external_ref = models.IntegerField(
blank = True,
default=None,
help_text = 'External System reference',
null=True,
verbose_name = 'Reference Number',
) # external reference or null. i.e. github issue number


external_system = models.IntegerField(
blank = True,
choices=Ticket_ExternalSystem,
default=None,
help_text = 'External system this item derives',
null=True,
verbose_name = 'External System',
)


description = models.TextField(
blank = True,
Expand Down

0 comments on commit 033f47b

Please sign in to comment.