Wouldn't it be great if users could overload save_m2m ?
If you agree, I volunteer to do the ticket and pull request. Else I'll
leave my hack in my app :(
Regards
Stephen Burrows
unread,
May 25, 2012, 4:14:27 AM5/25/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
It's definitely possible for users to support commit=False. If you call form.save(commit=False), you can then store form.save_m2m in a temporary variable, define a new save_m2m function, and then call the old function from the new. Here's sort of an example: https://github.com/pculture/mirocommunity/blob/31688f2/localtv/user_profile/forms.py#L76. Does it a little differently, but the same result.
--Stephen
is_null
unread,
Jun 6, 2012, 5:08:24 AM6/6/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django-d...@googlegroups.com
Thanks for answering. It's "funny code" but it works indeed.