Code

Opened 3 years ago

Closed 3 years ago

#17338 closed New feature (wontfix)

[nonrel] supports_deleting_related_objects database feature flag

Reported by: jonash Owned by: nobody
Component: Database layer (models, ORM) Version: master
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 jonash 3 years ago.

Download all attachments as: .zip

Change History (2)

Changed 3 years ago by jonash

comment:1 Changed 3 years ago by carljm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed
  • Type changed from Uncategorized to New 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.