On Wednesday, April 11, 2012 5:15:51 AM UTC-4, Hassan Alnatour wrote:
>
> Dear ALL,
>
> how can i make a default image for a image upload field in db i tried this 
> but its not working :
>
> Field('Cover','upload',default="URL('static','images')/no-user-image.gif"),
>

I haven't tried it, but maybe:

import os
db.define_table(...,
    Field('Cover', 'upload',
          default = lambda: open(os.path.join(request.folder, 'static', 
'images',
                                 'no-user-image.gif'), 'rb')),
    ...)

Anthony

Reply via email to