Re: Group by paramether in getSome()

Jacob Smullyan <[email protected]> Fri, 24 Jun 2005 23:44:09 -0400
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
On Sat, Jun 25, 2005 at 04:50:12AM +0200, Faber wrote:
> On Saturday 25 June 2005 04:25, Jacob Smullyan wrote:
> Yes, I'm working on that and it seems to work  ;)
> How can I submit my changes to you?

The best way is to submit a patch against the svn trunk to me or the list.
 
> > But would it be that useful, given that the result set in getSome() is
> > fixed and can't contain aggregates?
> 
> Oh, the result CAN contain aggregates, with a simple project() trick  ;)
> You should know...

Oh dear, I'd hadn't thought of that!  I knew that I permitted
projections to contain columns that weren't declared in the parent
class, but hadn't thought of the loophole I was creating.

> Oh, I was talking about project()... Here's a couple of "bugs" I've found:
> 
> * To read the value of an aggregate field I've to use the dictionary type 
> access: instance["aggregate_alias"] instead of instance.aggregate_alias
> Annoying, but I can live with this

This is odd.  Is this true for other columns a projection might
sneakily add?  I'll add a test case.

> * In last beta of PyDO the getUnique() method doesn't work on projected 
> classes. Example:

[snip]

So the problem seems to arise when you are using a projection of a
projection, something I hadn't tested.  I will.
 
> > Could you give an example of a query that you want to run with getSome()
> > that has a group by clause? 
 
[snip]

OK.  Again, I hadn't thought of how you might sneak aggregates in with
project().  I'm not yet sure about how supportable that approach will
be; I'll look at it.  Thanks for enlightening me, and for the bug
reports!

js

-- 
Jacob Smullyan
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCvNMJuqamFyFXXLIRAu9GAKCfyi+S+TmbfXhQjMes2nTILK6RawCgka2A
vMTJDE5UCT7YOeX1injt8eI=
=9NoL
-----END PGP SIGNATURE-----