#5780: pass the created/updated object to formsets in edit_inline for validation
--------------------------------------+-------------------------------------
Reporter: Honza_Kral | Owner: nobody
Status: new | Milestone: 1.0 alpha
Component: Admin interface | Version: newforms-admin
Resolution: | Keywords: nfa-blocker ep2008
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
--------------------------------------+-------------------------------------
Comment (by Honza_Kral):
Replying to [comment:6 jkocherhans]:
> Hey Honza... I may be dense here, but if you're using commit=False when
saving the forms, where do the objects get saved and will m2m fields be
saved? I wonder if we could use transaction.commit_manually here and just
roll the transaction back if any of the formsets fail validation.
Thoughts?
Hi Joseph, the transaction thing should work for the main issue, but there
is still the issue of some custom non db-related validation that could be
done in formsets.
The object is saved in {{{.save_add()}}} and {{{.save_change()}}} - there
is
{{{
new_object = form.save(commit=True)
}}}
I haven't touched that but we could pass in the {{{obj}}} as well and just
call
{{{
obj.save()
form.save_m2m()
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/5780#comment:7>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---