#2288: Provide an equivalent for 'ON DELETE' and friends
---------------------------+------------------------------------------------
Reporter: ubernostrum | Owner: adrian
Status: new | Component: Core framework
Version: | Resolution:
Keywords: | Stage: Design decision needed
Has_patch: 0 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------+------------------------------------------------
Comment (by [EMAIL PROTECTED]):
for example, in the project where i work currently,
having to catch the integrityError would be perfectly fine.
in my case basically i do not want to enable the deleting of objects when
their deletion would delete also other objects.
so having this integrityError exception is completely fine. (i would catch
it, and display an user-friendly error-message).
(i just wanted to provide an example-situation)
of course, more complex handling of these situations would be nice too,
but even the integrityError solution helps a lot,
because currently there's just no way to do it.
(a completely different direction to approach this problem would be to
document the code that django uses to determine
which objects to "cascade-delete", so that we could call that method, and
find out if there are any "depending" objects.
but of course the integrityError solution is more robust)
--
Ticket URL: <http://code.djangoproject.com/ticket/2288#comment:9>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---