Snippet List
By enabling this backend:
AUTHENTICATION_BACKENDS = (
'path.to.my.backends.CaseInsensitiveModelBackend',
)
Your users will now be able to log in with their username, no matter whether the letters are upper- or lower-case.
- auth
- case
- case-insensitive
- backend
- insensitive
This tag allow you to use C-like switch tag in your templates.
It is useful for sequencial and repetitive `{% ifequal %}` tags.
To install it in your project, you just need to follow [these instructions](http://www.djangoproject.com/documentation/templates_python/#extending-the-template-system)
- tag
- conditional
- switch
- case
Meant mostly as a demo of how to do complex block tags, here's a switch/case implementation.
It's deliberately simplistic: no default cases, no multiple values for the same case, etc. This is so that you can focus on the technique.
Pay particular attention to how both switch and case pull out their child nodes and save them for later rendering. This is a very useful technique for these types of "structured" template tags.
- templatetag
- switch
- case
- flow
- logic-doesnt-belong-in-templates
3 snippets posted so far.