Keith Pettit
unread,Jul 9, 2009, 2:38:09 PM7/9/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
I'm using inlineformset_factory to create a database entry with child objects. All works well for submiting a recording then returning to a record list. But I need a way to submit the new record then continue editing the same document or reference it after submit.
I though there was something similar to doing a "pk = obj.save()" but I can't seem to find the right way to do it.
Right now this is how I save my form/formset if you see any way I could approach this to get the database object id let me know.
# Parent Object (Ticket)
obj = form.save(commit=False)
obj.owner = request.user.get_profile()
obj.save()
# Child Items (Load)
formset = inlineformset_factory(Ticket, Load, fk_name="ticket", form=LoadForm)(request.POST, request.FILES, instance=obj)
if formset.is_valid():
formset.save()
Thanks,
Keith Pettit