On Tue, Aug 26, 2008 at 4:41 PM, Andrew D. Ball <[EMAIL PROTECTED]>wrote:

>
> Is there a convenient way to get all objects related to
> a given model instance?  I want to check for objects
> that would be deleted with a cascading delete before
> actually performing a deletion.
>

The admin does this, it presents you with a page showing all the related
objects that will be deleted when you choose 'Delete' on an object that is
linked to others.  Assuming you want to do this outside of the context of
admin, the code is in django/contrib/admin/util.py get_deleted_objects.
>From a brief look I'd so no, there's no "convenient" way to do this...the
admin routine is nearly 100 lines of code.  I assume if there was an easier
way they would have used it instead of writing all that code.

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to