sehmaschine/django-filebrowser — pull request #171 by melinath (2013-06-07 18:28:59+00:00)
Title: Set up version templatetags to use parser.compile_filter().

Pull request for #155.

Using parser.compile_filter() consistently has several benefits:

1. it makes the code cleaner, since everything (quoted strings as well as variables) can be treated as a variable which is resolved.
2. it removes the necessity for error-prone checking of whether something is a quoted string.
3. it allows filters to be used everywhere. For example, it would now be legal to say ``{% version "hardcoded/path/to/th.ing" variable_size %}`` or ``{% version my_image.path|default:"path/to/default.jpg" version|default:"big" %}``

I've also set up the version_object tag to actually have the ``as `` argument be optional. I could be wrong, but it looks like if ``as `` is not used, ``{% version_object %}`` becomes the same as ``{% version %}`` - in which case it might make sense to add an optional ``as `` to the ``{% version %} tag and deprecate ``{% version_object %}``... but that's a separate issue.