Skip to content

Commit

Permalink
feat(models): add LanguageMixin class
Browse files Browse the repository at this point in the history
  • Loading branch information
koeaw committed Mar 28, 2024
1 parent 5efb2ec commit ee1c888
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions apis_ontology/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,29 @@ def full_title(self):
return full_title


class LanguageMixin(models.Model):
class Languages_ISO_639_3(models.TextChoices):
"""
A selection of ISO 639-3 language codes
relevant to the project.
"""

DE = "deu", _("Deutsch")
EN = "eng", _("Englisch")
FR = "fra", _("Französisch")

language = models.CharField(
max_length=3,
choices=Languages_ISO_639_3.choices,
blank=True,
default="",
verbose_name=_("Sprache"),
)

class Meta:
abstract = True


@reversion.register
class DataSource(models.Model):
"""
Expand Down

0 comments on commit ee1c888

Please sign in to comment.