From e20e7e69b627e8b3b7f8021ad04fab9a4bd9246a Mon Sep 17 00:00:00 2001 From: Graham Knapp <32717635+dancergraham@users.noreply.github.com> Date: Tue, 26 Nov 2024 19:08:34 +0100 Subject: [PATCH 1/2] Add `WAFFLE_SWITCH_MODEL` to Configuring Waffle page Fixes #454 Add `WAFFLE_SWITCH_MODEL` and `WAFFLE_SAMPLE_MODEL` settings to the "Configuring Waffle" documentation page. --- docs/starting/configuring.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/starting/configuring.rst b/docs/starting/configuring.rst index fe48bcb2..02a54d8f 100644 --- a/docs/starting/configuring.rst +++ b/docs/starting/configuring.rst @@ -28,6 +28,22 @@ behavior. Needs to be set at the start of a project, as the Django migrations framework does not support changing swappable models after the initial migration. +``WAFFLE_SWITCH_MODEL`` + The Django model that will be used for switches. Defaults to ``waffle.Switch``, which + provides basic switch functionality. This can be swapped for a custom Switch model if + additional fields or behaviors are needed. The custom model must inherit from + ``waffle.models.AbstractBaseSwitch``. Needs to be set at the start of a project, as + Django’s migration framework does not support changing swappable models after the + initial migration. + +``WAFFLE_SAMPLE_MODEL`` + The Django model that will be used for samples. Defaults to ``waffle.Sample``, which + provides basic sample functionality. This can be swapped for a custom Sample model if + additional fields or behaviors are needed. The custom model must inherit from + ``waffle.models.AbstractBaseSample``. Needs to be set at the start of a project, as + Django’s migration framework does not support changing swappable models after the + initial migration. + ``WAFFLE_SWITCH_DEFAULT`` When a Switch is undefined in the database, Waffle considers it ``False``. Set this to ``True`` to make Waffle consider undefined From 3a2c876df0711da7bb8a91abe42f4ea5b8648eaa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:08:41 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/starting/configuring.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/starting/configuring.rst b/docs/starting/configuring.rst index 02a54d8f..c70289ab 100644 --- a/docs/starting/configuring.rst +++ b/docs/starting/configuring.rst @@ -29,19 +29,19 @@ behavior. support changing swappable models after the initial migration. ``WAFFLE_SWITCH_MODEL`` - The Django model that will be used for switches. Defaults to ``waffle.Switch``, which - provides basic switch functionality. This can be swapped for a custom Switch model if - additional fields or behaviors are needed. The custom model must inherit from - ``waffle.models.AbstractBaseSwitch``. Needs to be set at the start of a project, as - Django’s migration framework does not support changing swappable models after the + The Django model that will be used for switches. Defaults to ``waffle.Switch``, which + provides basic switch functionality. This can be swapped for a custom Switch model if + additional fields or behaviors are needed. The custom model must inherit from + ``waffle.models.AbstractBaseSwitch``. Needs to be set at the start of a project, as + Django’s migration framework does not support changing swappable models after the initial migration. ``WAFFLE_SAMPLE_MODEL`` - The Django model that will be used for samples. Defaults to ``waffle.Sample``, which - provides basic sample functionality. This can be swapped for a custom Sample model if - additional fields or behaviors are needed. The custom model must inherit from - ``waffle.models.AbstractBaseSample``. Needs to be set at the start of a project, as - Django’s migration framework does not support changing swappable models after the + The Django model that will be used for samples. Defaults to ``waffle.Sample``, which + provides basic sample functionality. This can be swapped for a custom Sample model if + additional fields or behaviors are needed. The custom model must inherit from + ``waffle.models.AbstractBaseSample``. Needs to be set at the start of a project, as + Django’s migration framework does not support changing swappable models after the initial migration. ``WAFFLE_SWITCH_DEFAULT``