On Tuesday, March 13, 2012 11:18:35 PM UTC+1, praveen krishna wrote:
>
> Hii,
> I am getting an error at line 9: in creating an image blog in
> ubuntu(linux) 11.10 ,I have installed the web2py through terminal
>
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
>
> 10.
> 11.
> 12.
> 13.
>
>
> def show():
> image = db(db.image.id==request.args(0)).select().first()
> db.comment.image_id.default = image.id
> form = SQLFORM(db.comment)
> if form.process().accepted:
>
> response.flash = 'your comment is posted'
> comments = db(db.comment.image_id==image.id).select()
> return dict(image=image, comments=comments, form=form)
>
>
> return dict(image=image, comments=comments, form=form)
>
> I am not getting how to sort it out .
> and the script which I used in default.py is
> def index():
> images = db().select(db.image.ALL, orderby=db.image.title)
> return dict(images=images)
>
> def show():
> image = db(db.image.id==request
> <http://127.0.0.1:8000/examples/global/vars/request>.args(0)).select().first()
> db.comment.image_id.default = image.id
> form = SQLFORM
> <http://127.0.0.1:8000/examples/global/vars/SQLFORM>(db.comment)
> if form.process().accepted:
> response <http://127.0.0.1:8000/examples/global/vars/response>.flash
> = 'your comment is posted'
> comments = db(db.comment.image_id==image.id).select()
> return dict(image=image, comments=comments, form=form)
>
> def download():
> return response
> <http://127.0.0.1:8000/examples/global/vars/response>.download(request
> <http://127.0.0.1:8000/examples/global/vars/request>, db)
>
> response <http://127.0.0.1:8000/examples/global/vars/response>._vars=response
> <http://127.0.0.1:8000/examples/global/vars/response>._caller(show)
>
>
>
>
>