diff --git a/src/django_stockfin_db/models.py b/src/django_stockfin_db/models.py index 71a8362..91094e1 100644 --- a/src/django_stockfin_db/models.py +++ b/src/django_stockfin_db/models.py @@ -1,3 +1,29 @@ -from django.db import models +from django.db.models import Model, CharField, ForeignKey, TextChoices, PROTECT +from django.utils.translation import gettext_lazy as _ -# Create your models here. + +class FinancialPosition(Model): + + class FinStmt(TextChoices): + BS = 'BS', _("Balance Sheet") + IS = 'IS', _("Income Statement") + CF = 'CF', _("Cash Flow Statement") + + financial_statement = CharField( + max_length=2, + db_index=True, + choices=FinStmt.choices, + verbose_name=_("Financial statement") + ) + name = CharField( + max_length=255, + db_index=True, + verbose_name=_("Position name") + ) + parent = ForeignKey( + to='self', + on_delete=PROTECT, + null=True, + blank=True, + verbose_name=_("Parent position") + )