get_querystring template tag
A Django Template tag used to construct urls with current querystring parameters. This is based on some code that I've written some years ago. Enjoy.
- template
- templatetag
- querystring
A Django Template tag used to construct urls with current querystring parameters. This is based on some code that I've written some years ago. Enjoy.
For several projects I am using generic views instead of django-admin, I needed a generic view for constance instead of using their django-admin based app.
Decorator to make a view only accept requests from AJAX calls. Usage:: @require_xhr() def my_view(request): # Returns data # ... by [skam](http://skam.webfactional.com/)
Originally posted on [skam.webfactional.com](http://skam.webfactional.com/blog/2007/07/16/babel-integration-django/) This is a very simple middleware that uses babel (http://babel.edgewall.org) for accessing locale data in request objects through request.LOCALE attribute. It also provides a function to get locale data outside views. settings.py: MIDDLEWARE_CLASSES = ( ... cut ... 'django.middleware.locale.LocaleMiddleware', 'middleware.locale.BabelMiddleware', ... cut ... )
newforms widget for autocompleting text fields using jquery autocomplete plugin: http://jquery.bassistance.de/autocomplete/ to be implemented: - store the pk value into an hidden field - handling ChoiceFields and many others massimo dot scamarcia at gmail.com
Simple template filter to encode a variable to JSON format Usage: {% load json_filters %} {% block content %} <script type="text/javascript"><![CDATA[ var items = {{ items|jsonify }}; ]]></script> {% endblock %} I'm using JsonResponse for the views but I also want to have preloaded JSON data into the page output
dirt and simple template filter to convert a number to its roman value. taken from dive into python http://www.diveintopython.org/unit_testing/stage_5.html
template tag for producing tag clouds for a given model, using django-tagging application: http://code.google.com/p/django-tagging/ Sample: http://skam.webfactional.com/tags/ Usage: {% tags_cloud_for_model articles.Article as object_list %} {% tags_cloud_for_model articles.Article as object_list step 6 %}
skam has posted 8 snippets.