From bbe8e4a721c0998871c1f036ba1f19e05548cbe5 Mon Sep 17 00:00:00 2001 From: Matthew Foster Walsh <15671892+mfosterw@users.noreply.github.com> Date: Sun, 25 Feb 2024 15:28:50 -0500 Subject: [PATCH] Improve status choices documentation --- democrasite/webiscite/models.py | 6 +++++- docs/conf.py | 10 +++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/democrasite/webiscite/models.py b/democrasite/webiscite/models.py index b226f44..4b07fc6 100644 --- a/democrasite/webiscite/models.py +++ b/democrasite/webiscite/models.py @@ -119,6 +119,10 @@ class Bill(StatusModel, TimeStampedModel): pull_request = models.ForeignKey(PullRequest, on_delete=models.PROTECT) class Status(models.TextChoices): + """The possible statuses for a bill + + :meta private:""" + OPEN = "open", _("Open") APPROVED = "approved", _("Approved") REJECTED = "rejected", _("Rejected") @@ -126,7 +130,7 @@ class Status(models.TextChoices): # Translators: PR is short for "pull request" CLOSED = "closed", _("PR Closed") # PR closed on Github - #: + #:-: The possible statuses for a bill. Use ``Bill.Status.VALUE`` to access. STATUS = Status.choices status = StatusField( max_length=10, diff --git a/docs/conf.py b/docs/conf.py index 812fd8b..73b552a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,17 +13,17 @@ import os import sys -# import django +import django if os.getenv("READTHEDOCS", default="False") == "True": os.environ["DJANGO_READ_DOT_ENV_FILE"] = "True" os.environ["USE_DOCKER"] = "no" sys.path.insert(0, os.path.abspath("..")) # noqa: PTH100 django_settings = "config.settings.local" -# os.environ["DATABASE_URL"] = "sqlite:///readthedocs.db" -# os.environ["CELERY_BROKER_URL"] = os.getenv("REDIS_URL", "redis://redis:6379") -# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") -# django.setup() +os.environ["DATABASE_URL"] = "sqlite:///readthedocs.db" +os.environ["CELERY_BROKER_URL"] = os.getenv("REDIS_URL", "redis://redis:6379") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local") +django.setup() # -- Project information -----------------------------------------------------