Hello, everyone ^ I'm asking you a question because there's a blockage during study as an official document of Jango. 1.9 In the N:1 data field definition, it is defined as ForeignKey followed by (self, on_delete=models.CASCADE). I wonder what the on_delete=models.CASCADE syntax does. I looked it up, but I don't know ㅠ<
^ django
When Model A and Model B have an N:1 relationship, if Model A has the on_delete=models.CASADE syntax set, if any record in Model B is deleted, the records in Model A related to the record in Model B to be deleted are also deleted annually.
If on_delete is not set, it cannot be deleted because there are records from other models that reference the records from model B.
You can think of CASCADE as having the same effect (behavior) on a model that is not directly directed to do something, but that it has the same effect (behavior
549 PHP ssh2_scp_send fails to send files as intended
546 Understanding How to Configure Google API Key
548 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
712 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
538 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.