If you can somehow express the function of your bar
function in terms of searching with double underlining ORM, then you can create FilterSpec in Django 1.3
See django.contrib.admin.filterspecs
These classes handle the creation of a list of filter options and prepare the request value for the URL, etc. As far as I can tell, they work by providing the field_path
attribute, which is used by other parts of the admin code to filter the set of change requests.
An example of a custom FilterSpec filter:
http://djangosnippets.org/snippets/2644/
source share