This software offers Django fields that support many to many and foreign key relations, which can be Ajax filtered.
Technical details of the package involve an Ajax request that is sent when the user clicks on the chosen filter. The request returns the matching elements in JSON format, utilizing the popular jQuery JavaScript library.
Installation is quite simple. Included in the distribution is the Ajax_filtered_fields package that should be placed on the Python path.
Usage of the package is equally as simple. Let's say you want to put the MyModel model in a many-to-many relation with the RelatedModel model via the related_models field. You'll need to copy the ajax_filtered_fields.js Javascript file included in media/js/ within the distribution to your media directory. Then, add this line to your Django project's urls.py: (r'^ajax_filtered_fields/', include('ajax_filtered_fields.urls')).
In the model form, simply choose the field you want to use and reference the formerly copied Javascript file, the jQuery library, and the Django Admin's Javascript code that mutates the select widget into a select filter.
If the form is being used outside of the autogenerated Django Admin, you'll need to load several Django Admin's Javascript files from the page where the field will be shown. Additionally, if you want i18n for ManyToManyByLetter, ForeignKeyByLetter, ManyToManyByStatus, and ForeignKeyByStatus fields (available fields), add 'ajax_filtered_fields' to the INSTALLED_APPS in your settings.py. The only languages currently available are English and Italian.
Overall, Django-ajax-filtered-fields is an incredibly useful package that makes filtering a breeze for Django developers. Installation is quick and easy, and the package is incredibly interpretable. The combination of Ajax requests and JSON format make for a smooth experience for the user. Highly recommended.
Version 0.5: N/A