Hi Massimo,

 

My use case is really to give the user the option to view data stored in a 
table without the ability to change anything hence readonly. Once they have 
finished viewing the form (normally by hitting the submit button) they will be 
redirected to whatever.

 

Hope it makes sense

John

 

From: web2py@googlegroups.com [mailto:web2py@googlegroups.com] On Behalf Of 
Massimo Di Pierro
Sent: 21 March 2020 07:36
To: web2py-users
Subject: [web2py] Re: Py4web readonly Form

 

You may be right but what is the meaning of submitting and accepting a readonly 
form? What is a use case?


On Friday, 6 March 2020 00:53:17 UTC-8, John Bannister wrote:

Hi All,

 

I have been testing Py4web and have the following to produce basically a 'view 
record' option :-

 

def view_test():

    form=Form(db.auth_user, record=1, readonly=True, deletable=False, 
formstyle=FormStyleBulma)

    if form.accepted:

        redirect(URL('index'))

    return dict(form=form)

 

This will redirect if I remove the readonly=True from the form but basically 
form is just displayed (all fields are readonly) and you can hit the submit 
button as many times as you like and nothing will happen.

 

Any ideas??

 

BR

John

 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2089781a-8a2e-4b62-90d4-98a6183b375b%40googlegroups.com
 
<https://groups.google.com/d/msgid/web2py/2089781a-8a2e-4b62-90d4-98a6183b375b%40googlegroups.com?utm_medium=email&utm_source=footer>
 .

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/033e01d5ff58%2453f3f700%24fbdbe500%24%40gmail.com.

Reply via email to