Re: column aliases in PyDO

Faber <[email protected]> Wed, 2 Aug 2006 18:33:04 +0200
Newsgroups gmane.comp.web.skunkweb
Organization FaberBox
Message-ID <[email protected]>
On Wednesday 02 August 2006 18:22, Jacob Smullyan wrote:

> Hello, PyDO2 users (especially Faber!):

Thanks, Jacob  ;-)

> A long time ago now, Faber undertook to persuade me that the ability to
> use project() to add aggregate columns was a feature.  I was very
> resistant; I hadn't intended it and it scared me.  (What can I say, I
> used to program in Java and still haven't entirely gotten over it.)

> I just checked in changes to make this work, with 1 test.  Usage would be
> like so:
>   >>> p=myObj.project(Field('count(*)', asname='count'))
>   >>> o=p.getSome()[0]
>   >>>o.count
>
>   44
>
> I'll also soon make it possible to accomplish the same by:
>
>   myObj.project('count(*) as count')
>
> Aliases have other use cases as well, of course  -- when you have a
> column called "class", for instance.

Yeah, as for other aggregates such as MAX, AVG, etc...

That's a great news, I'm happy you've rethinked about the question  :-)

Cheers

-- 
Faber
http://faberbox.com/
http://smarking.com/

Anyone who slaps a 'this page is best viewed with Browser X' label on a Web 
page appears to be yearning for the bad old days, before the Web, when you 
had very little chance of reading a document written on another computer, 
another word processor, or another network. -- Tim Berners-Lee

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV