views:

1138

answers:

1

I have a Person table and Phone table. The Phone table has a foreign key into the Person table, which is an auto-increment ID. Each person can have an arbitrary number of phone numbers. Is there a way for me to create a Django form to enter phone numbers while creating a new Person entry and edit them along with an existing Person entry?

+3  A: 

Yes, Django's inlineformset_factory is exactly what you need.

Docs: Model Formsets and Inline formsets

This snippet should help you as an example.

Van Gale
I think you're right -- this looks like exactly what I need. Thanks!
Fred Larson