Answer the question
In order to leave comments, you need to log in
Django: search in admin by ForeignKey?
In general, I faced such a problem. There is a certain model, with a couple of fields. There is one big model where one of the fields is this little model bound as a ForeignKey. Everything would be fine, but it is impossible to search by these fields in the admin panel (if you add them to search_fields, an error occurs when you try to search). Also, there is no way to organize filtering on them - if you add them to list_filter, then the elements for the filter simply do not appear in the menu on the right - as if they are not in list_filter at all. I'm using admin_tools and Django 1.4. Are there any options for getting out of the situation?
Answer the question
In order to leave comments, you need to log in
Custom page
You write your own view, catch id, make a selection and transfer it to a custom template. I did this using django-grappelli. I redefined the template from grappelli, added my own cycle. Came out like a native
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question