From 2cb176a349cf8dc16ffed639af4144cb4def91a3 Mon Sep 17 00:00:00 2001 From: Graham Knapp <32717635+dancergraham@users.noreply.github.com> Date: Tue, 3 Dec 2024 23:05:56 +0100 Subject: [PATCH 1/4] Add Read the docs status badge (#537) The documentation build was broken for many months this year but this was not immediately visible anywhere on the GitHub repo. I propose to add a read the docs status badge rather than an actions status badge as this is a better source of truth about the documentation build status --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 4d483d10..d4e18c6a 100644 --- a/README.rst +++ b/README.rst @@ -15,6 +15,10 @@ a number of ways. .. image:: https://badge.fury.io/py/django-waffle.svg :target: https://badge.fury.io/py/django-waffle :alt: PyPI status badge +.. image:: https://img.shields.io/readthedocs/waffle + :target: https://app.readthedocs.org/projects/waffle + :alt: Read the Docs + :Code: https://github.com/jazzband/django-waffle :License: BSD; see LICENSE file From a85782b8b8f6461679f99ccb2f4a74c65d6d6dad Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:02:43 -0800 Subject: [PATCH 2/4] [pre-commit.ci] pre-commit autoupdate (#538) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.0 → v0.8.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.0...v0.8.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9959d22..9c474e6f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.0 + rev: v0.8.3 hooks: - id: ruff From 2dd8facdbd00082cbd34b0a2cafcf811d5655f03 Mon Sep 17 00:00:00 2001 From: Graham Knapp <32717635+dancergraham@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:06:02 +0100 Subject: [PATCH 3/4] Improved API documentation (#539) Added missing attributes and methods. --- docs/conf.py | 2 +- docs/types/flag.rst | 34 ++++++++++++++++++++++------------ docs/types/sample.rst | 18 ++++++++++++++---- docs/types/switch.rst | 17 +++++++++++++---- 4 files changed, 50 insertions(+), 21 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 06d55864..367ee37e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -119,7 +119,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. diff --git a/docs/types/flag.rst b/docs/types/flag.rst index 5e984736..238993c8 100644 --- a/docs/types/flag.rst +++ b/docs/types/flag.rst @@ -43,33 +43,33 @@ Flag Attributes Flags can be administered through the Django `admin site`_ or the :ref:`command line `. They have the following attributes: -:Name: +:name: The name of the flag. Will be used to identify the flag everywhere. -:Everyone: +:everyone: Globally set the Flag, **overriding all other criteria**. Leave as *Unknown* to use other criteria. -:Testing: +:testing: Can the flag be specified via a querystring parameter? :ref:`See below `. -:Percent: +:percent: A percentage of users for whom the flag will be active, if no other criteria applies to them. -:Superusers: +:superusers: Is this flag always active for superusers? -:Staff: +:staff: Is this flag always active for staff? -:Authenticated: +:authenticated: Is this flag always active for authenticated users? -:Languages: +:languages: Is the ``LANGUAGE_CODE`` of the request in this list? (Comma-separated values.) -:Groups: +:groups: A list of group IDs for which this flag will always be active. -:Users: +:users: A list of user IDs for which this flag will always be active. -:Rollout: +:rollout: Activate Rollout mode? :ref:`See below `. -:Note: +:note: Describe where the flag is used. A Flag will be active if *any* of the criteria are true for the current @@ -85,6 +85,16 @@ are in the group *or* if they are in the 12%. the actual proportion of users for whom the Flag is active will probably differ slightly from the Percentage value. +Flag Methods +============ + +The Flag class has the following public methods: + +:is_active: + Determines if the flag is active for a given request. Returns a boolean value. +:is_active_for_user: + Determines if the flag is active for a given user. Returns a boolean value. + .. _types-flag-custom-model: diff --git a/docs/types/sample.rst b/docs/types/sample.rst index 651aa5db..fba72ae8 100644 --- a/docs/types/sample.rst +++ b/docs/types/sample.rst @@ -42,13 +42,23 @@ Sample Attributes Samples can be administered through the Django `admin site`_ or the :ref:`command line `. They have the following attributes: -:Name: +:name: The name of the Sample. -:Percent: +:percent: A number from 0.0 to 100.0 that determines how often the Sample will be active. -:Note: - Describe where the Sample is used. +:note: + Describes where the Sample is used. + + + +Sample Methods +============== + +The Sample class has the following public methods: + +:is_active: + Determines if the sample is active. Returns a boolean value. .. _admin site: https://docs.djangoproject.com/en/dev/ref/contrib/admin/ diff --git a/docs/types/switch.rst b/docs/types/switch.rst index 8b0ee30a..1e5d654a 100644 --- a/docs/types/switch.rst +++ b/docs/types/switch.rst @@ -15,17 +15,26 @@ Switch Attributes Switches can be administered through the Django `admin site`_ or the :ref:`command line `. They have the following attributes: -:Name: +:name: The name of the Switch. -:Active: +:active: Is the Switch active or inactive. -:Note: - Describe where the Switch is used. +:note: + Describes where the Switch is used. .. _admin site: https://docs.djangoproject.com/en/dev/ref/contrib/admin/ +Switch Methods +============== + +The Switch class has the following public methods: + +:is_active: + Determines if the switch is active. Returns a boolean value. + + .. _types-custom-switch-models: Custom Switch Models From 8eb58fb256354dd9fe71141ef1e40c2008da3608 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 23:11:27 +0100 Subject: [PATCH 4/4] [pre-commit.ci] pre-commit autoupdate (#540) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.8.3 → v0.8.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.3...v0.8.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c474e6f..4a39d196 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,6 +6,6 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.3 + rev: v0.8.4 hooks: - id: ruff