#2749: [patch] Deleting object with generic relation does not work with one to
one
------------------------+---------------------------------------------------
Reporter: clong | Owner: adrian
Status: reopened | Component: Core framework
Version: SVN | Resolution:
Keywords: | Stage: Unreviewed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
------------------------+---------------------------------------------------
Changes (by [EMAIL PROTECTED]):
* cc: [EMAIL PROTECTED] (added)
Comment:
I am also encountering the same problem and have LOST heaps of data due to
it and had to ask site administrators to avoid any deletion of any data
for the while.
I have noticed, that by trying to remove {{{models.GenericRelation(...)}}}
from models in which objects are often deleted improves situation, but
data stil gets lost on models, where {{{GenericRelation}}} fields can't be
removed.
Also in the Favo's suggeston, he says that correct deletion should be like
this:
{{{
#!sql
DELETE FROM tag WHERE object_id =1 and content_type = xxx;
}}}
but I think, if you wish to delete a specific tag, then it would be best
to just delete the tag by tag's
{{{tag1.id}}} like this:
{{{
#!sql
DELETE FROM tag WHERE id =''tag1.id'';
}}}
I believe Favo's example would still delete '''all''' tags that relate to
{{{photo1}}} instead of just the selected {{{tag1}}}.
----
This ticket is related to #3215, it is clearly a '''bug''', it causes
unexpected '''data loss''' and is '''critical'''.
--
Ticket URL: <http://code.djangoproject.com/ticket/2749#comment:4>
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
-~----------~----~----~----~------~----~------~--~---