views:

642

answers:

3

Hi

I have a "Person" Model which has a one-to-many Relations to other Models, for instance Address. I want to edit these models on the same page as Person, which I can already do via inlines. But I also want to change the order of the fields.

I want the (inline) field "Address" to be the third item in the list, but for

fields ('first_name', 'last_name', 'Adress_Inline', 'nationality' etc..) I get this: PersonAdmin.fields' refers to field 'Address_Inline' that is missing from the form.

Is there a way to change the order of the fields and get certain inline-Fields between 'regular' Model fields?

Thank You!

A: 

You would have to manually extend the admin template (change_form.html) and hard-code positions into it. AFAIK, you cannot insert inline formsets into the middle of a parent form.

Jeff Ober
A: 

hm. ok. thank you

A: 

You can do that with javascript. You need to override the template and maybe add some div tag. Then hardcode your div's that you want copied and then hide the original div (with the inline). I hope that helps.

orwellian