sorry - i should have checked the faq (i was reading the manual).

thanks again for the speedy, helpful replies.  andrew

On Aug 29, 11:40 am, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On Aug 29, 2008, at 11:22 AM, andrew cooke wrote:
>
>
>
> > Hi,
>
> > Not sure if I'm misunderstanding what's happening, whether I have a
> > bug, or whether this is normal behaviour, but as far as I can tell
> > mapped objects that are returned from a query do not have their
> > constructor called.  Is that correct?
>
> yes.
>
> > In a bit more detail - I have a mapping defined to class Metric, and a
> > query() returns a Metric instance, with the correct attributes, but if
> > in the constructor I have something like:
>
> > class Metric(object):
> >    def __init__(self):
> >        self.constructor_called = True
>
> > then the instance returned by query does not have the
> > "constructor_called" attribute (my actual code is more complex, but
> > that's the general idea).
>
> > Is this normal behaviour?  Is there any way to get the constructor to
> > be called?  I can work around this if not, but would liek to be sure I
> > am not ignoring an error of some kind.
>
> an FAQ entry on this is here:  
> http://www.sqlalchemy.org/trac/wiki/FAQ#whyisntmy__init__calledwhenIl...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to