On Apr 4, 8:43 pm, "Rick Morrison" <[EMAIL PROTECTED]> wrote:
> > - two big new Query features, which are temporarily underscored until
> > we get some feedback on them:  _values(), which limits the Query to
> > returning just tuples of specfic columns as in
> > query.filter(...)._values(A.id, A.name),
>
> Wouldn't this kind of feature be more natural to include in the Query
> constructor itself, to make Query() somewhat orthogonal with select()?
>
> i.e.
>          session.query([MappedObject.id,
> MappedObject.name]).filter(...).all()
>
> instead of
>          session.query(MappedObject).filter(...).values(MappedObject.id,
> MappedObject.name).all()

I actually like _values (and _select_from) because it gives you the
option to modify *existing* query. This is useful because you don't
have know everything at the time of query creation (you can write
library functions that operate on user-created queries). It is also
consistent with generative nature of query/select.

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