are you creating the form object before or after this?
You need to specify attributes before the creation of the form object.
db.table.field.readable = False
form = FORM()
return dict(form=form)
My way of doing it
if 'register' in request.args:
auth_user_opt =
['twitter','facebook','photo_source','profilename','gender','photo','bio','phone','homepage','user_types','birthdate','privacy']
for field in auth_user_opt:
db.auth_user[field].readable = db.auth_user[field].writable =
False
On Wednesday, August 31, 2011, annet wrote:
> I have two fields in the auth_user table which I don't want to be
> visible when the user edits his profile. In def user(): I set:
>
> def user():
> ....
> if request.args(0)=='profile':
> db.auth_user.comment.readable=False
> db.auth_user.comment.writable=False
> db.auth_user.reply.readable=False
> db.auth_user.reply.writable=False
> ....
> return dict(form=form)
>
> However, this doesn't work the fields are still shown. What is the
> correct way to achieve this.
>
>
> Kind regards,
>
> Annet.
--
--
Bruno Rocha
[ About me: http://zerp.ly/rochacbruno ]
[ Aprenda a programar: http://CursoDePython.com.br ]
[ O seu aliado nos cuidados com os animais: http://AnimalSystem.com.br ]
[ Consultoria em desenvolvimento web: http://www.blouweb.com ]