Copied from http://code.google.com/p/django-ajax-filtered-fields/