Yes there are better ways. Instead of
def index():
def plus_minus():
""" add or subtract likes """
post=db(db.blog.id==request.args(0)).select().first()
db.plus_minus.pm_id.default=post.id
db.plus_minus.insert(plus=1)
db.commit()
redirect(URL('index'))
On Thursday, 6 December 2012 15:38:18 UTC-6, jonas wrote:
>
> hi
>
> I have a controller that basically inserts a number in a database. I don't
> want it to render any view. For now I just redirect back to index.html, but
> is there any other way to do it, i.e to have a controller that not renders
> any views?
>
> controller:
>
> def plus_minus():
>
> """ add or subtract likes """
>
> post=db(db.blog.id==request.args(0)).select().first()
> db.plus_minus.pm_id.default=post.id
> db.plus_minus.insert(plus=1)
> db.commit()
>
> redirect(URL('index'))
>
>
--