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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to