diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a9959d22..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.0 + rev: v0.8.4 hooks: - id: ruff 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 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