Open MatthewEthanTam opened 2 weeks ago
Would find use for this in my projects using django-waffle
Hi! I'm just starting with open source and I'd love to give this a try.
@clintonb @dancergraham bump
Hello, I don't really use templates so I don't have an opinion on this and wouldn't be much help getting started on a PR - I would start by putting a question on the django forum to see whether anyone has a good shorthand for this using existing template features such as https://docs.djangoproject.com/en/5.1/ref/templates/builtins/#with with statements (random idea - don't know whether it is relevant.
In my usage of Django-waffle, I found that I cannot use the switch template tag within an if statement's condition in Django templates as some blocks of code require both the switch to be active and another context variable to be set.
Please find an example of this case below:
Suggestion: I suggest we make template filters for
switch_is_active
,flag_is_active
, andsample_is_active
, this will allow the reduction of redundant code in this scenario.an example of this suggestion is below:
If this is a good suggestion, I can make a PR for it.