Quickly create an admin interface for an app.
This creates an admin interface for each model in the "your_appname" app. It also adds each column to the admin list view. Place this in the admin.py of "your_appname".
- models
- admin
- legacy
This creates an admin interface for each model in the "your_appname" app. It also adds each column to the admin list view. Place this in the admin.py of "your_appname".
Add the attribute "rel='lightbox'" to all Links, if the target is an image. `<a href="/path/to/image.jpg">Image</a>` becomes `<a rel="lightbox" href="/path/to/image.jpg">Image</a>` Works for JPG, GIF and PNG Files.
Looks up for a template based on the template-name plus the current users language code. Loads the template and renders it with the current context. Example:: {% langinclude "foo/some_include.html" %} Based on the users LANGUAGE_CODE, assumed we have 'de', it tries to render the template 'foo/some_include.html.de'. If that doesn't exists, it renders the template 'foo/some_include.html'. This is the default behavior of the include-Tag. Basically this is a shortcut for the following code, just with a fallback for the default template:: {% ifequal LANGUAGE_CODE "de" %} {% include "foo/some_include.html.de" %} {% else %} {% include "foo/some_include.html" %} {% endifequal %} --- Ein deutscher [Weblogeintrag mit Beschreibung](http://www.mahner.org/weblog/sprachabhangige-template-imports/)
Caches a view based on the users language code, a cache_key and optional function arguments. The cache_key can be a string, a callable or None. If it's None, the the name of the decorated function is used. You can pass a tuple `func_args` of arguments. If passed, these arguments are part of the cache key. See examples for details.
Create a random integer with given length. - For a length of 3 it will be between 100 and 999. - For a length of 4 it will be between 1000 and 9999. Use it in a template like: {% random_number as my_id %} The id is {{ my_id }}
This tiny snippets grabs the sourcecode out of a template name without rendering or compiling the template itself.