[web2py] readable and writable question

2013-09-03 Thread António Ramos
hello my code if not auth.has_membership('admin'): * db.trabalhador.val_formacao.writable=False* form=SQLFORM(db.trabalhador,row.id, showid=False, submit_button="Gravar", fields=['nome','bi','ncart','ncartval','rfid','apt_medica','apt_medicaval',* 'val_formac

Re: [web2py] readable and writable question

2013-09-03 Thread Richard Vézina
Cut and paste from the book : When a field is marked with writable=False, the field is not shown in create forms, and it is shown readonly in update forms. If a field is marked aswritable=False and readable=False, then the field is not shown at all, not even in update forms. Forms created with f

Re: [web2py] readable and writable question

2013-09-03 Thread António Ramos
What i want to say and dont know why is that coding *db.trabalhador.val_formacao.writable=False* *db.trabalhador.val_formacao.readable=False* * * *before my sqlform* * * Results int the field beeing displayed and editable That is not what i want I want to hide the field in the form 2013/9/3 V

Re: [web2py] readable and writable question

2013-09-03 Thread Vinicius Assef
On Tue, Sep 3, 2013 at 12:47 PM, António Ramos wrote: > > shows the val_formação label only, no input text Because Web2py shows readable fields as text, not as a readonly field. You see nothing probably because the field has no contents in this record. -- --- You received this message becau

Re: [web2py] readable and writable question

2013-09-03 Thread António Ramos
2013/9/3 Richard Vézina > Not sure I understand what you want to say here : "shows the val_formação > label only, no input text" > *Not sure I understand what you want to say here : "shows the val_formação label only, no input text"* * * i meant no editable input "field" in the webpage. -- --

Re: [web2py] readable and writable question

2013-09-03 Thread Vinicius Assef
On Tue, Sep 3, 2013 at 1:55 PM, António Ramos wrote: > > I want to hide the field in the form So, don't include its name in fields list. -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving e

Re: [web2py] readable and writable question

2013-09-03 Thread Richard Vézina
That it's you need both in case you want to se the field input but prevent your user to alter the value, you can set readonly=True in your SQLFORM() call... :) Richard On Tue, Sep 3, 2013 at 12:55 PM, António Ramos wrote: > What i want to say and dont know why is that coding > > *db.trabalhad

Re: [web2py] readable and writable question

2013-09-03 Thread Richard Vézina
ahHA! I never use fields in SQLFORM didn't thought about this one... Richard On Tue, Sep 3, 2013 at 1:09 PM, Vinicius Assef wrote: > On Tue, Sep 3, 2013 at 1:55 PM, António Ramos > wrote: > > > > I want to hide the field in the form > > So, don't include its name in fields list. > > -- > > -

Re: [web2py] readable and writable question

2013-09-03 Thread António Ramos
auth !! 2013/9/3 António Ramos > I have to include them in the field list because i have another line of > code to detect it > if aut.has_membership('admin') > > show the field and allow it to be edited > > else > Dont show the field( this is where i have the problem. > > > > > 2013/9/3 Viniciu

Re: [web2py] readable and writable question

2013-09-03 Thread Richard Vézina
You could create a kind of user_table_access_profile mechanism for each table. You start by setting every fields to readable and writable false then base on a user authentified you can switch field to true base on a user_table_access_profile. There is plenty of data structure you can use to store

Re: [web2py] readable and writable question

2013-09-03 Thread António Ramos
I have to include them in the field list because i have another line of code to detect it if aut.has_membership('admin') show the field and allow it to be edited else Dont show the field( this is where i have the problem. 2013/9/3 Vinicius Assef > On Tue, Sep 3, 2013 at 1:55 PM, António Ram

Re: [web2py] readable and writable question

2013-09-03 Thread Vinicius Assef
On Tue, Sep 3, 2013 at 2:17 PM, António Ramos wrote: > I have to include them in the field list because i have another line of code > to detect it > if aut.has_membership('admin') > > show the field and allow it to be edited So, just insert your field in this situation. Make the fields list varia

Re: [web2py] readable and writable question

2013-09-04 Thread António Ramos
*Make the fields list variable.* Bingo! Thank you. 2013/9/3 Vinicius Assef > On Tue, Sep 3, 2013 at 2:17 PM, António Ramos > wrote: > > I have to include them in the field list because i have another line of > code > > to detect it > > if aut.has_membership('admin') > > > > show the field an