Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Oct. 24, 2005 15:47:36

c.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Cascade on delete?


If I define a model with foreign keys, use MySQL/MyISAM as a backend,
and delete a referenced object, does django implement a "cascade on
delete" to clean up child objects, or do I need to manually clean up
the child objects?

Thanks,
Casey

Offline

#2 Nov. 3, 2005 17:13:27

Adrian H.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Cascade on delete?


On 10/24/05, cmars232 <> wrote:
> If I define a model with foreign keys, use MySQL/MyISAM as a backend,
> and delete a referenced object, does django implement a "cascade on
> delete" to clean up child objects, or do I need to manually clean up
> the child objects?

Yes, if you use the .delete() method on model objects, child objects
are deleted recursively.

Adrian

--
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Offline

Board footer

Moderator control

Enjoy the 20th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support