views:

25

answers:

1

Hi there,

I was wondering what's the best way o modify django-admin? That is, the best way to modify it and keep compatibility with future releases?

Specifically Im refering to the search_fields where using (=field) gets converted to field_iexact in the query construction when I need field_exact ?

I just to make modifications in a way that they are applicable in future releases.

Thanks, Angel

A: 

It is not possible to change the default search, the place where the __iexact lookup is constructed is actually in the core of the admin system. So it's not solvable by implementing your own admin or meta derivations.

You could try to override the admin template and inlude your own search form, but this will require a lot of recoding as you will need to hack in some javascript in the list display, you'll also need to find a way to fiddle with the list's queryset. This however is very likely to be supported throughout the whole 1.x release. It can however be you need to adapt your template a bit if you want to support new admin features of future releases.

KillianDS