On Tue, 2008-04-29 at 00:03 +0400, Ivan Sagalaev wrote: > Hello everyone (and especially Malcolm :-) ) > > I've just hit a wall with a behavior that I find a bit strange. When a > model is instantiated from a queryset result it's not created with it's > own constructor but instead uses Model.from_sequence that does creates > an Empty() instance and then changes its __class__ to a Model. > > So here are couple of thoughts: > > - am I right that it's done for performance reason? > - I think it should be documented as a backwards incompatible change > since people do overload Model.__init__ (at least I did :-)) > - what's the recommended way of doing things like settings some simple > attributes on a model instance instead of using constructor?
I forgot that people might be overriding __init__ like this. I need to rethink it. Somebody brought it up on django-users and I've asked them to file a ticket. We shouldn't break existing code like that. (I'm going to revert the use of form_sequence() in a minute so that existing code continues to work.) Malcolm -- The early bird may get the worm, but the second mouse gets the cheese. http://www.pointy-stick.com/blog/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
