[web2py] Re: how to set a default image for an SQLFORM 'upload' field?

2011-05-30 Thread Luis Goncalves
Forgot to mention, I need this on google appengine. My hack so far: - create a new DB table, 'default images' db.define_table('default_images', Field('name', requires=IS_NOT_EMPTY()), Field('uploaded','upload', requires=IS_NOT_EMPTY())) - create a admin-only

[web2py] Re: how to set a default image for an SQLFORM 'upload' field?

2011-05-30 Thread pbreit
In my views, I check for an image and if there isn't one, display a dummy. No sense in storing that for each record.

[web2py] Re: how to set a default image for an SQLFORM 'upload' field?

2011-05-30 Thread Massimo Di Pierro
I agree. {{=IMG(_src=row.image and URL('download,args=row.image) or URL('static','dummy.png'))}} On May 30, 10:11 am, pbreit pbreitenb...@gmail.com wrote: In my views, I check for an image and if there isn't one, display a dummy. No sense in storing that for each record.

[web2py] Re: how to set a default image for an SQLFORM 'upload' field?

2011-05-30 Thread Luis Goncalves
Perfect! Thanks!! These tidbit examples are invaluable! As I learn web2py, I am taking notes of where I get stuck, in order to eventually provide suggestions for improving the doc/manual from the novice's eyes (once you already know everything, it isn't as obvious what's missing). The