Opened 13 years ago

Closed 13 years ago

#17338 closed New feature (wontfix)

[nonrel] supports_deleting_related_objects database feature flag

Reported by: Jonas H. Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: nonrel
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

(This patch is part of the changes made to the inofficial fork "Django-nonrel" which adds basic support for non-relational databases.)

Introduces a supports_deleting_related_objects database feature. If deleting related objects isn't supported by the backend, related object collection is skipped when deleting an object.

Attachments (1)

supports-deleting-related.patch (1.3 KB ) - added by Jonas H. 13 years ago.

Download all attachments as: .zip

Change History (2)

by Jonas H., 13 years ago

comment:1 by Carl Meyer, 13 years ago

Resolution: wontfix
Status: newclosed
Type: UncategorizedNew feature

This ticket doesn't make sense to me, as Django's related-object-deletion code doesn't depend on any particular support from the backend, other than the basic abilities to query for things and delete them. It is (sort of) _emulating_ SQL cascading deletes, but it does so in a way that doesn't assume anything at all from the backend.

It might make some sense to be able to mark backends according to whether they support "related objects" (e.g. FKs) at all, and then skip related-object-collection on deletion if not. Though I'm not sure even that would be necessary - in the case of a backend not supporting related fields, I'd presume that would be caught much earlier (like in model validation); at the point of deletion, if the model has no related fields, the deletion code won't try to collect any related objects anyway, no particular extra check is needed.

Note: See TracTickets for help on using tickets.
Back to Top