I have two models in Django that are related with a OneToOneField
(PrinterProfile
and PrinterAdress
).
I am trying to do a form with
You have to create second form for PrinterAddress
and handle both forms in you view:
if all((profile_form.is_valid(), address_form.is_valid())):
profile = profile_form.save()
address = address_form.save(commit=False)
address.printer_profile = profile
address.save()
Of course in the template you need to show both forms under one tag :-)