Opened 6 years ago

Closed 6 years ago

#15345 closed (invalid)

Model inheritance: wrong action of child_class_instance.delete()

Reported by: truongsinh Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


class Place(models.Model):

description = models.TextField()
def unicode(self):

return self.description

def reload(self):

self = Place.objects.get(id =

class Restaurant(Place):

name = models.TextField()

from myapp.models import *
p1 = Place.object.create(description = "description1")
r1 = Restaurant.object.create(id =, description = p1.description, name =name)
r1 = Restaurant.objects.get(id =
# return expected error
p1 = Place.objects.get(id =
# return unexpected error, possible because that row is also deleted

Change History (2)

comment:1 Changed 6 years ago by truongsinh

Component: UncategorizedDatabase layer (models, ORM)
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:2 Changed 6 years ago by truongsinh

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top