On 3/7/06, kmh <[EMAIL PROTECTED]> wrote: > > Thanks for the nice roundup. Votes may be in but just to clarify: my > primary objection is that assignment is fundamentally a name-binding > operation in Python and in this case what is bound to the name is not > what is returned.
The fact that the descriptor protocol exists at all suggests to me that GvR & co intend for interpretations of assignment other than strict name-binding. In addition, your alternative would have 'X = article.reporter_set' provide useful data, but 'article.reporter_set = X' throw an exception - this asymmetry strikes me as much more confusing than the absence of strict name binding. That said, I now have a better appreciation for the source of your objection. I still disagree, though :-) - and it looks like the majority of other respondents do too. Thanks for raising your concern - I value any opinion that someone is willing to take the time to explain, even if we don't agree. > > 4) Reverse descriptors and save() have an interesting relationship. Given: > > > a) make add()/remove()/clear()/__set__ implicit save points. This > > Would there be a way to create non-persistent instances with relations? I agree that its an interesting use case, but it seems to be restricted in the existing implementation (trunk and existing MR). How do you create a temporary object with an m2m relation? m2m relations are committed to the database table as soon as you add them. If both objects haven't been saved/don't have a primary key, adding the relation throws an exception. > > b) make save() cascade into related objects - r1.save() cascades the > > a1.save() call because of the relation. However, a1.save() wouldn't > > have to cascade into r1.save() > > This is the behaviour I would prefer but I am not sure about the > difficulties of implementation. Not especially difficult, if its the right thing to do. However, I'm with Hugo on this one - the potential for unintended consequences and duplicated saves is pretty high. Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@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-developers -~----------~----~----~----~------~----~------~--~---