Ticket #5450: save_m2m_with_new_instance.diff

File save_m2m_with_new_instance.diff, 566 bytes (added by Øyvind Saltvik <oyvind@…>, 17 years ago)
  • django/newforms/models.py

     
    3636            continue
    3737        f.save_form_data(instance, cleaned_data[f.name])       
    3838    # Wrap up the saving of m2m data as a function
    39     def save_m2m():
     39    def save_m2m(*args):
     40        instance = args and args[0] or instance
    4041        opts = instance.__class__._meta
    4142        cleaned_data = form.cleaned_data
    4243        for f in opts.many_to_many:
Back to Top