do you have a def download(): in controllers/default.py ?
That one is the main handler for using URL('default', 'download',
args=row.something) as a "downloader" of an 'upload' record.
On Wednesday, December 5, 2012 6:41:58 PM UTC+1, jonas wrote:
>
> hi
>
> this is probably a trivial problem but I post it anyway:
>
> I have an image model:
>
> db.define_table('blog',
> Field('date','datetime',default=request.now),
> Field('image','upload'),
> Field('imageTitle','text',default="image text"),
> Field('title','text'),
> Field('text','text'))
> # format = '%(title)s')
>
> and the following controller:
>
> query=db.blog.id>0
> res=db(query).select(orderby=~db.blog.date)
>
> return dict(res=res)
>
> but when I want to display my images they cannot be found:
>
> {{for result in res:}}
> <h2><i class="icon-off"></i> {{=result.title}}</h2>
> <small>{{=result.date}}</small>
> {{if result.image:}}
> <h5>if true...</h5>
> <img width="800px" height="600px"
> src="{{=URL('download',args=result.image)}}" />
> <h5><i class="icon-camera"></i> {{=result.imageTitle}}</h5>
> {{pass}}
> {{pass}}
>
> it seems that the img tag looks in the wrong dir: /default/download which
> doesn't exist. do I have to create it or is there another way?
>
--