Display/Edit fields across tables in a Django Form
Posted
by jamida
on Stack Overflow
See other posts from Stack Overflow
or by jamida
Published on 2010-05-22T18:58:26Z
Indexed on
2010/05/22
19:10 UTC
Read the original article
Hit count: 468
I have 2 tables/models, which for all practical purposes are the same as the standard Author/Book example, but with the additional restriction that in my application each Author can only write 0 or 1 books. (eg, the ForeignKey field in the Book model is or can be a OneToOneField, and there may be authors who have no corresponding book in the Book table.)
I would like to be able to display a form showing multiple books and also show some fields from the corresponding Author table (eg author_name, author_address). I followed the example of the inlineformset and but that doesn't even display the author name in the generated form.
© Stack Overflow or respective owner