before date simply enables a flag if the current date is before the given date. This is the inverse of the existing after date condition.
and performs a boolean AND on a list of conditions (the Django-Flags default is an OR), which means all the conditions in the and value must evaluate to True before the flag will be enabled.
The and condition, if given in Python code (i.e. with the Django settings flag source) takes a list of two-tuples containing ('condition name', expected_value). If given as a string (i.e. in the Django admin using the database flag source) it can contain a string with comma-separated pairs with one condition, value pair per line.
To facilitate the multi-line strings (and any other possible custom conditions that users of Django-Flags might create, this PR also changes the database flag state form's widget to a text area instead of an input box. This makes and conditions possible to create in the UI, but it's still a bit clunky.
This PR adds two new conditions:
before date
simply enables a flag if the current date is before the given date. This is the inverse of the existingafter date
condition.and
performs a boolean AND on a list of conditions (the Django-Flags default is an OR), which means all the conditions in theand
value must evaluate toTrue
before the flag will be enabled.The
and
condition, if given in Python code (i.e. with the Django settings flag source) takes a list of two-tuples containing('condition name', expected_value)
. If given as a string (i.e. in the Django admin using the database flag source) it can contain a string with comma-separated pairs with one condition, value pair per line.Per the documentation:
And:
To facilitate the multi-line strings (and any other possible custom conditions that users of Django-Flags might create, this PR also changes the database flag state form's widget to a text area instead of an input box. This makes
and
conditions possible to create in the UI, but it's still a bit clunky.