Changes between Version 1 and Version 2 of Ticket #33579, comment 7
- Timestamp:
- Sep 21, 2022, 2:00:24 PM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33579, comment 7
v1 v2 1 1 Another alternative we would be to simply raise a `cls.DoesNotExists` error instead. 2 2 3 It would be backward incompatible in the sense that a different exception type would be raised but it seems it would fit elegantly with the message it's meant to convey; the object that was attempted to be updated was not found. It would also make code that handles generic `DoesNotExist` and turn them into HTTP 404 automatically pick up errors of this form without any form ofspecial casing.3 It would be backward incompatible in the sense that a different exception type would be raised but it seems it would fit elegantly with the message it's meant to convey; the object that was attempted to be updated was not found. It would also make code that handles generic `DoesNotExist` and turn them into HTTP 404 automatically pick up errors of this form without any special casing. 4 4 5 5 Another argument for this approach is that the affected ''base'' is already available from `Model._save_table` via the `cls` kwarg so it would also allow to differentiate which model row was missing when dealing with concrete model inheritance that require update against multiple tables.