I need a nested django admin inline, which I can include the date field inlines in an other inline like below.
I have the models below:
class Person
I used the solution provided by @bigzbig (thank you).
I also wanted to go back to the first list page once changes had been saved so added:
class MyModelInline(EditLinkToInlineObject, admin.TabularInline):
model = MyModel
readonly_fields = ('edit_link', )
def response_post_save_change(self, request, obj):
my_second_model_id = MyModel.objects.get(pk=obj.pk).my_second_model_id
return redirect("/admin/mysite/mysecondmodel/%s/change/" % (my_second_model_id))