On Sat, Apr 3, 2010 at 8:59 PM, arr.ee <[email protected]> wrote:
> Hello,
>
> I have a site, which uses web.py and shadowbox.js, as well as
> postgresql.
> In one of my templates i have following code:
>
> $code:
>    stores = db.select('stores',
>                       what='address,maplink,photo',
>                       where='active=TRUE',
>                       order='position ASC')

Why do you query a database in the template?

I think it'd make a lot more sense if you passed ``stores`` as a
parameter to your template like

    #code.py
    stores = db.select(...)
    return render.images(stores)

Or you need it in the template for some reason?

Regards,


-- 
Branko Vukelić

Check out my blog: http://www.brankovukelic.com/
Check out my portfolio: http://www.flickr.com/photos/foxbunny/
Registered Linux user #438078 (http://counter.li.org/)

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to