Changes between Version 1 and Version 2 of Ticket #33579, comment 7


Ignore:
Timestamp:
Sep 21, 2022, 2:00:24 PM (20 months ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33579, comment 7

    v1 v2  
    11Another alternative we would be to simply raise a `cls.DoesNotExists` error instead.
    22
    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 of special casing.
     3It 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.
    44
    55Another 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.
Back to Top