-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Em 16-08-2012 20:07, pbreit escreveu:
> I'd rather stay in app code. If I do db.executesql(..., as_dict=True) could I
> copy that into a Storage object to get something roughly similar to a DAL 
> object?
> 
> I started trying to build it in DAL and got part of the way. I was seeing a
> problem with the counts where it wasn't executing multiple counts correctly. 
> If
> I had 2 or 3 counts they all reported the same number.
> 
> Forgetting the MATCHes, do you think I should be able to get the LEFT JOINs 
> and
> COUNTs working?
> 
> -- 
>  
>  
>  

Usually I use something like this to address that problem:

from gluon.storage import Storage

rows = db.executesql(..., as_dict=True)
list = []
for r in rows:
  list.append( Storage( r )
return list

- -- 
Com os melhores cumprimentos,

Carlos Correia
=========================
MEMÓRIA PERSISTENTE, Lda.
Tel.: 219 291 591 - GSM:  917 157 146 / 967 511 762
e-mail: [email protected] - URL: http://www.memoriapersistente.pt
Jabber: [email protected]
GnuPG: wwwkeys.eu.pgp.net
URL Suporte (experimental): https://ky.m16e.com (certificado auto-assinado)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAys7EACgkQ90uzwjA1SJXu2gCdGMKBvZm9JX6cOF1Dz67RqShR
LZEAoIPJlMOxC2poe8bRBCcFL6i1uU4m
=lPTx
-----END PGP SIGNATURE-----

-- 



Reply via email to