Check condition in Form Queryset
Check a condition (in this example only equality) on every queryset item in a django form
- form
- test
- condition
- check
Check a condition (in this example only equality) on every queryset item in a django form
*WARNING* This is *extremely* slow. This snippet allows you to easily prevent *most* race conditions (if used properly). Feel free to extend on top of this as you like, I'd appreciate any comments to [email protected]
This is a conditional templatetag decorator that makes it *very* easy to write template tags that can be used as conditions. This can help avoid template boilerplate code (e.g. setting a variable in your template to be used in a condition). All you have to do is define a function with expected parameters that returns True or False. Examples are in the code.
3 snippets posted so far.