Opened 10 years ago

Closed 8 years ago

#2666 closed defect (fixed)

redefined save methods not always called when using edit_inline

Reported by: GoClick Owned by: jkocherhans
Component: contrib.admin Version: newforms-admin
Severity: major Keywords: nfa-fixed
Cc: Triage Stage: Fixed on a branch
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by adrian)

Given something loseley like this

class a(models.Model):
  def save(self):
    super(a, self).save()

class b(models.Model):
  ta = models.ForeignKey(a, edit_inline=models.TABULAR, num_in_admin=5)
  def save(self):
    super(b, self).save()

when I edit an a in the admin and press save the save method is called. However if I edit the b objects inline the save method for a is not called even if there were changes made to the a object aswell, the object seems to be getting saved with the superclass' save method not the new redefined one.

Change History (7)

comment:1 Changed 10 years ago by adrian

  • Description modified (diff)

Fixed formatting in description.

comment:2 Changed 9 years ago by anonymous

Has anybody looked at this? I'm having the same problem with a custom photo field, where Django is calling the photo field's super class (ImageField) save() instead.

comment:3 Changed 9 years ago by SmileyChris

  • Summary changed from redefined save methods not always called when using free admin to redefined save methods not always called when using edit_inline

comment:4 Changed 9 years ago by ubernostrum

  • Owner changed from nobody to jkocherhans
  • Version set to newforms-admin

#5573 was a duplicate.

Also, reassigning to Joseph so he can add tests for this to newforms-admin.

comment:5 Changed 9 years ago by brosner

  • Keywords nfa-fixed added

This is fixed in newforms-admin. It takes on the same nature that newforms works with save_instance in django.newforms.models.

comment:6 Changed 8 years ago by jacob

  • Triage Stage changed from Unreviewed to Fixed on a branch

comment:7 Changed 8 years ago by brosner

  • Resolution set to fixed
  • Status changed from new to closed

This is no longer a problem since the merge of newforms-admin in [7967].

Note: See TracTickets for help on using tickets.
Back to Top