undefer accepts *args so that you could define a path from the parent object of 
the query down to the child:

query(Parent).options(undefer(Parent.child, Child.subchild, 
Subchild.someattribute))

The public docs currently don't really explain this detail, unless you were to 
guess that undefer() works like joinedload(), subqueryload(), etc. where we 
have more explicit documentation of this behavior.



On Jul 2, 2010, at 7:13 AM, Oliver Beattie wrote:

> Hi there,
> 
> The documentation for the undefer() method seems to indicate that it
> should be able to accept multiple positional arguments for keys,
> however trying this results in an error. I wanted to post this here to
> check I'm right in thinking this before I file a ticket. The docs give
> the signature as `undefer(*keys)`, but the description refers to "key"
> as singular, so I'm not sure. In any case, doing something like this
> results in an error:
> 
>    query.options(undefer(*columns))
> 
> results in an error, while this obviously does not:
> 
>    query.options(*[undefer(c) for c in columns])
> 
> So it's not a big deal. The stack trace I get is here: http://dpaste.org/Dpgi/
> 
> -- 
> 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.
> 

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