[sqlalchemy] Re: Can I remove a Column from the select() result set

2007-11-17 Thread Michael Bayer


On Nov 17, 2007, at 12:26 AM, Matt Culbreth wrote:


 Howdy Group,

 Let's say I have a very simple query:  select person.id, person.name,
 person.age from person

 Can I remove one of the columns, say person.age, from this result
 set and still use the list as a RowProxy?  I'm trying to do it now and
 it's not working.  I'm creating a new list and appending all but the
 last (for example) columns, but it's then missing the RowProxy
 goodness.

 I realize I can do this in the original select, but I'm doing some
 client-side logic here and I need to manipulate the dataset.


well if you use list operations etc. on the RowProxy or ResultProxy  
youll get just a plain list (or dict, depending on what youre doing).

within SA, we use a lot of decorator like approaches, not the python  
@decorator thing but rather another collection class that wraps the  
original RowProxy.

you'd have to illustrate what you're specifically trying to do for us  
to have some suggestions.

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



[sqlalchemy] Re: Can I remove a Column from the select() result set

2007-11-17 Thread Matt Culbreth

Thanks Michael.

To make a long story short, I'm appending a couple columns onto a
query, running it, and then using those two extra columns for some
client-side logic (involving calculations to be precise).  At the end
of that logic, I need to remove those two extra columns.  I'd like to
be able to do that and keep the RowProxy stuff.

There's a workaround though so it's not a big deal.  I've looked
through the code and it seems I'd be going too far outside of the core
design to keep doing this.


On Nov 17, 11:03 am, Michael Bayer [EMAIL PROTECTED] wrote:
 On Nov 17, 2007, at 12:26 AM, Matt Culbreth wrote:



  Howdy Group,

  Let's say I have a very simple query:  select person.id, person.name,
  person.age from person

  Can I remove one of the columns, say person.age, from this result
  set and still use the list as a RowProxy?  I'm trying to do it now and
  it's not working.  I'm creating a new list and appending all but the
  last (for example) columns, but it's then missing the RowProxy
  goodness.

  I realize I can do this in the original select, but I'm doing some
  client-side logic here and I need to manipulate the dataset.

 well if you use list operations etc. on the RowProxy or ResultProxy  
 youll get just a plain list (or dict, depending on what youre doing).

 within SA, we use a lot of decorator like approaches, not the python  
 @decorator thing but rather another collection class that wraps the  
 original RowProxy.

 you'd have to illustrate what you're specifically trying to do for us  
 to have some suggestions.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---