(django 1.2.4)
I have two different unrelated (there is no foreign key relationship between them) django models.
For example, let’s say: ‘School’ and ‘Teacher’.
What I need is that, when I open add/edit view in django admin interface for ‘School’ object to have inline formset of Teacher objects. Obiously this won’t be FK relationship, but rather logical relationship (example: teachers that are in same country as school…).
Form I need to display is standard model form.
I have a function that would give me list (queryset if needed) of teachers for given school.
Is it possible to implement something like this?
Not exactlly solution for my problem, but I ended up inheriting ModelAdmin class and overriding change_view method, implementing functionality I needed (retrieving objects I need and passing them through context to change_form template, which I also extended).
… and ended up really liking Django AdminSite extensibility