Changes between Version 1 and Version 2 of Ticket #33263, comment 2


Ignore:
Timestamp:
Nov 4, 2021, 9:19:36 AM (3 years ago)
Author:
Carlton Gibson

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33263, comment 2

    v1 v2  
    1313Happy to take input but after staring at it multiple times, for a long time, the only stable conclusion was to separate the `post()` HTTP handler from the `delete()` HTTP handler — proxying one to the other doesn't leave space for the form and messaging behaviour. (See the historical PRs for attempts in this direction.) Someone sending an API-like HTTP DELETE method request gets the old behaviour here. It's only browser based POST requests that are affected.
    1414
    15 Continuing to proxy `post()` to `delete()`, as the PR here suggests, ends up duplicating the `get_object()` and `get_success_url()` calls (essentially from the two mixins, but inlined in this case because of the tangled inheritance structure, [https://github.com/django/django/pull/14634/files#diff-bf5815bb9e60d6b9f1a261957863a70cc9ad03efdbd7941c0e1659b7ceb2895fR237-R240 see comment].) Doing that is less than ideal: with the added `FormMixin` behaviour, `post()` is a much more complex handler than `delete()` — they're no longer equivalent.
     15Continuing to proxy `post()` to `delete()`, as the PR here suggests, ends up duplicating the `get_object()` and `get_success_url()` calls (essentially from the two mixins, but inlined in this case because of the tangled inheritance structure, [https://github.com/django/django/pull/14634/files#diff-bf5815bb9e60d6b9f1a261957863a70cc9ad03efdbd7941c0e1659b7ceb2895fR237-R240 see comment].) Proxying the handlers is less than ideal: with the added `FormMixin` behaviour, `post()` is a much more complex handler than `delete()` — they're no longer equivalent.
    1616
    1717On the final PR [https://github.com/django/django/pull/14634#discussion_r669325533 Mariusz and I discussed adding an extra `_delete` hook, to be called by both `delete()` and `form_valid()` but agreed is was too much API].
Back to Top