2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 12:35:46 +00:00

Adds 'status_text' functions to models (#3752)

- Convert status codes into text representation (translated)
- Useful for template rendering
This commit is contained in:
Oliver
2022-10-07 00:18:11 +11:00
committed by GitHub
parent cfff5ea264
commit d194aef79e
3 changed files with 20 additions and 0 deletions

View File

@ -236,6 +236,11 @@ class Build(MPTTModel, ReferenceIndexingMixin):
help_text=_('Build status code')
)
@property
def status_text(self):
"""Return the text representation of the status field"""
return BuildStatus.text(self.status)
batch = models.CharField(
verbose_name=_('Batch Code'),
max_length=100,