Hi,
    Does SqlAlchemy query call __init__ on the mapped object?

    i.e. Say I have mapped the object to table as follows:
    mapper(Obj, Table)
    Now, table contains:
     index  integer
     x integer
     y integer

    And Obj is defined as
    Class Obj:
      def __init__(self, x, y):
         self.x = x
         self.y = y
         self.z = True

    I have a query later:
     for query in session.query(Obj).order_by(Obj.index):
 --->     print query.z
      This fails saying that z is not an element of query.

    I was under the impression that query will return back initialized
objects with data updated with data from DB. But this doesnt seem to
be the case.
    Could someone please help me out? Am I doing something wrong here?



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to