Ok so after doing a bit more research

I have come across this:

http://www.web2py.com/examples/static/epydoc/web2py.gluon.sqlhtml.SQLFORM-class.html

and I have done this

    listing_id = request.args(0)
    query = (db.listing.id[listing_id]) & (db.listing.userinfo[auth.user.id])

    form = SQLFORM(db.listing, query, formstyle='divs')

But I am passing an int as a value and it says on this page

if record is an int::

    record=db.table[record]

But that is what I am doing and I am getting

TypeError: cannot concatenate 'str' and 'int' objects


Any ideas? *cheers

On Sun, Mar 10, 2013 at 3:21 PM, <[email protected]> wrote:

> Hello I am probably going about this wrong.
>
> But I am wondering if it is possible to do something like this with
> SQLFORM so I can pass on successful submission an update saying confirmed =
> False
>
> @auth.requires_login()
> def edit_listing():
>     listing_id = request.args(0)
>     query = db((db.listing.id == listing_id) & (db.listing.userinfo ==
> auth.user.id))
>     form = SQLFORM(query, formstyle='divs')
>     if form.accepts(request,session):
>         session.flash = 'You have successfully updated your listing'
>         return redirect(URL('user_control', 'listing'))
>     elif form.errors:
>         session.flash = 'Please correct the highlighted fields'
>         return dict(form=form)
>     else:
>         return dict(form=form)
>     return dict(form=form)
>
> *cheers and thank you for the help
>
>  --
>
> ---
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to