With session.query(User).options(undefer(User.column_a), defer(User.column_b), noload(User.column_c)) column_a will be loaded with the query, column_b will be loaded on access and column_c will be None regardless of the value in the database.
Ants On Oct 16, 12:56 pm, Alex K <[EMAIL PROTECTED]> wrote: > Hi All, > > I wonder if there is a way to set what columns of the object will be > used during this particular query, to reduce the query in case if I > need the object, but I don't need all object properties. > > is something like this: session.query(User).load('column_a') possible? > > session.query([...]) - won't apply, since i need mapped object. > > Thanks, > Alex --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---