Wiki

Clone wiki

django-annoying / Home

fork of http://bitbucket.org/offline/django-annoying plus some stuff

cache

instead of getting/setting cache for a query:

cache_get(key, time, klass, *args, **kwargs)

basically works like get_object_or_404

cache_filter(key, time, klass, *args, **kwargs)

as above, but returns query result or None. reserved kwargs are order and limit

middleware

WwwRedirectMiddleware

all urls with www

NoWwwRedirectMiddleware

better yet, no www

decorators

ajax_login_required

like login_required, returns json {'not_authenticated': True} with 401

template tags

media_url

return MEDIA_URL setting where no context available

template filters

ago

date format, rounded

Updated