Opened 5 years ago
Closed 5 years ago
#32308 closed Bug (invalid)
docs for db.models.restrict is incorrect
| Reported by: | Eliezer Kanal | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | 3.1 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The example in this section of the text seems incorrect. Specifically, artist_two.delete() has no reason to be restricted, as there are no Song objects for that artist. The RESTRICT keyword is only on the Song model.
Note:
See TracTickets
for help on using tickets.
Have you try this example? It works as described.
artist_twocannot be deleted because it is referenced through restricted foreign keys:Song.album.Closing per TicketClosingReasons/UseSupportChannels