> > row = db(db.post.author== auth.user.id).select(db.post.ALL, > orderby=~db.post.created_on, limitby=(0,1)).first() > reports = row.message if row else None >
If you are only returning the "message" field, just select the db.post.message field, no need to use db.post.ALL. > def search(): > form = SQLFORM(db.post).process() > if form.accepts(request, formname=None): > You cannot call form.accepts after having called form.process, as the latter already calls the former for you. > return DIV("Message posted") > elif form.errors: > return TABLE(*[TR(k, v) for k, v in form.errors.items()]) > return dict() > In all cases, you code will return an empty dict. If there is no associated view, you will get an error unless generic views have been enabled, in which case, you will get generic.html. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.