Don't forget http://code.djangoproject.com/ticket/7539. The patch is 
old--it's for Django 0.96--so it needs to be updated. Hopefully I'll 
manage to do this in the next week or two as we start moving our project 
from 0.96 to 1.0.x. But it to handles ON CASCADE DELETE / RESTRICT 
SET NULL behavior either in the db or in Django, at the developer's 
discretion.

Mike



Manuel Saelices wrote:
> 
> 
> On 16 feb, 01:28, Karen Tracey <[email protected]> wrote:
>> On Sun, Feb 15, 2009 at 7:03 PM, Manuel Saelices <[email protected]>wrote:
>> [snip background]
>>
>>
>>
>>> These are the reasons to think in a possible improvement in Django
>>> ORM. I've patched django to support a model like this:
>>> class Master(models.Model):
>>>    pass
>>> class Slave(models.Model):
>>>   master = models.ForeignKey(Master, null=True, delete_cascade=False)
>>> Independently in notation i've used, I think this concept can be
>>> useful in a lot of Django web sites.
>>> I've created a ticket for this and attached a patch with unit tests.
>>> This ticket was marked into "Design decision needed" stage by a
>>> triager, and this is the reason I post this.
>>> Ticket is this:
>>>  http://code.djangoproject.com/ticket/10262
>>> If other developers accept this ticket (maybe with another notation),
>>> I compromise to work on this.
>> This has come up before, see:
>>
>> http://code.djangoproject.com/ticket/2288
>>
>> That one was closed wontfix with a statement that pre-delete signals should
>> be able to handle this job.  If they don't they need to be fixed.  #6108
>> looks to be open as a follow-up to that.
>>
>> Is there anything new/different about this proposal than #2288?
> 
> There are a main difference: #10262 solution doesn't intend relying in
> database DELETE CASCADE features. It uses Django mechanism to collect
> objects to be deleted, and it will call to delete method on those (and
> emit signals too).
> 
> And with respect #6108 ticket, this ticket is an all or nothing
> solution. I only can stop deletion by raising an error if I don't like
> collected objects that would be deleted, but for example I can't
> change this object list to another I like.
> 
> Thing is I think Django ORM should implement relations between objects
> where usually one object must live independently the other. Ticket is
> not about DELETE CASCADE... is about modelling relations [1].
> 
> Regards
> 
> [1] http://ootips.org/uml-hasa.html
> 
>>  If not,
>> step one is going to have to be to convince Jacob that the wontfix on the
>> original ticket asking for this should be revisited.  Until then I don't see
>> a new proposal for the same thing going anywhere, and I'd recommend focusing
>> on getting the recommended alternative working instead (unless there is some
>> flaw in that, which would probably be a good reason to revisit the first
>> wontfix...but I haven' t seen anyone say there is a flaw in the alternative,
>> just some support -- possibly including design of that support -- that
>> hasn't been implemented yet?).
>>
>> Karen
> > 
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to