#12152 closed (fixed)
A child model's DoesNotExist doesn't extend the parent's
Description ¶
This should work:
class Fruit(models.Model): pass class Apple(Fruit): pass try: Apple.objects.get(id=1) except Fruit.DoesNotExist: pass
Change History (9)
by , 15 years ago
Attachment: | 12152-1.diff added |
---|
comment:1 by , 15 years ago
Has patch: | set |
---|
by , 15 years ago
Attachment: | 12152-2.diff added |
---|
comment:2 by , 15 years ago
milestone: | → 1.2 |
---|---|
Triage Stage: | Unreviewed → Accepted |
by , 15 years ago
Attachment: | django-exception-inheritance.diff added |
---|
comment:4 by , 15 years ago
(In [12568]) [1.1.X] Fixed #12152. DoesNotExist and MultipleObjectsReturned now subclass their parent model's exceptions. Backport of r12567 from trunk.
Note:
See TracTickets
for help on using tickets.
Better patch. I think.