I could be wrong, but I believe that this is because a Model is not  
derived from the default __metaclass__, but is generated by a separate  
class factory which overrides the default behavior.

On Apr 28, 2008, at 3:03 PM, 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?
>
> >


--~--~---------~--~----~------------~-------~--~----~
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