Thanks for the feedback.  I hadn't thought of doing it this way.

I did comb through the documentation a 2nd and 3rd time today though
and found the "add_column()" method for queries.  It looks like that
may be another way to get what I want.  I am thinking about even
creating a little builder function that takes the results from a query
with add_column and adds them back to the primary object as custom
attributes.

Now that I have a couple options, I think I can get at least one of
them to work. :)

-Allen

On Dec 7, 2007 3:11 PM, Paul Johnston <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> >1. Return a list of all User objects meeting a given criteria along
> >with a field that is a sum of all their order totals.
> >
> >
> You want to create another class and mapper, UserWithSum (or a
> friendlier name) that maps to an arbitrary select.
> http://www.sqlalchemy.org/docs/04/mappers.html#advdatamapping_mapper_selects
>
> >2. Find all users in a given state (User.c.state == "NY") with their
> >sum of all order totals being greater then some number X.
> >
> >
> Once you've achieved 1, this is pretty straightforward.
>
> Paul
>
> >
>

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

Reply via email to