Simon Willison’s Weblog

Subscribe

Tuesday, 3rd March 2009

Django snippets: Smart {% if %} template tag. Chris Beaven's drop-in replacement for Django's {% if %} tag that adds comparison operators (less than, greater than, not equal etc) while staying backwards compatible with the less able original. I love it. This is one place where I no longer favour Django's stated philosophy: I think it's perfectly reasonable to use comparisons in presentation logic, and I've found that in my own code the lack of an advanced if tag frequently leads to pure presentation logic sneaking in to my view functions.

# 3:03 pm / chris-beaven, django, if, python, templating

Combine JSONP and jQuery to quickly build powerful mashups. jQuery’s JSONP support is one of my favourite little-known features of the library.

# 3:17 pm / javascript, jquery, json, jsonp

2009 » March

MTWTFSS
      1
2345678
9101112131415
16171819202122
23242526272829
3031