-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1915 from bcgov/chore/243-add-report-version-model
243 ReportVersion model
- Loading branch information
Showing
15 changed files
with
278 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from django.db import models | ||
from common.models.base_model import BaseModel | ||
from reporting.models.report import Report | ||
|
||
|
||
class ReportVersion(BaseModel): | ||
|
||
report = models.ForeignKey( | ||
Report, | ||
on_delete=models.CASCADE, | ||
db_comment="The report to which this version applied.", | ||
related_name="report_versions", | ||
) | ||
is_latest_submitted = models.BooleanField( | ||
db_comment="True if this version is the latest submitted one", | ||
default=False, | ||
) | ||
|
||
class ReportVersionStatus(models.TextChoices): | ||
Draft = 'draft' | ||
Submitted = 'submitted' | ||
|
||
status = models.CharField( | ||
max_length=1000, | ||
choices=ReportVersionStatus.choices, | ||
db_comment="The status for this report version: draft or submitted.", | ||
default=ReportVersionStatus.Draft, | ||
) | ||
|
||
class Meta: | ||
db_table_comment = "A table representing the multiple versions that a single report can have." | ||
db_table = 'erc"."report_version' | ||
app_label = 'reporting' |
Oops, something went wrong.