From 2b811666a12f380a4cc129a8f7a82d9266090538 Mon Sep 17 00:00:00 2001 From: Graham Knapp <32717635+dancergraham@users.noreply.github.com> Date: Fri, 27 Dec 2024 16:45:51 +0100 Subject: [PATCH] Add `WAFFLE_SWITCH_MODEL` to Configuring Waffle page (#535) * 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. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/starting/configuring.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/starting/configuring.rst b/docs/starting/configuring.rst index fe48bcb2..c70289ab 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