Hi,
first of all, many thanks to Massimo and all other contributers.
web2py is an amazing framework and exactly what I was looking for.
Keep up the excellent work!
I've got a couple of questions and problems so I'll start with the one
which is bugging me the most:
I've defined the auth_user table, added username, password and some
other fields. So far everything works fine. Now I want to create a
form where the user can change the password. In this form I do not
want to modify any of the other fields. So I'm doing the following
before creating the SQLForm (user_table == db.auth_user):
for field in user_table.fields:
if field == 'password':
user_table[field].readable = user_table[field].writable = True
else:
user_table[field].readable = user_table[field].writable =
False
this works fine, the form only contains the password field. But when I
submit the form, I end up with the following error:
File "C:\Tools\web2py_src\gluon\sqlhtml.py", line 1202, in accepts
fields[field.name] = self.record[field.name]
File "C:\Tools\web2py_src\gluon\dal.py", line 3777, in __getitem__
return dict.__getitem__(self, key)
KeyError: 'registration_key'
so its trying to update a field which is writable==False. When I look
into the code in sqlhtml.py (line 1200) this is confusing me a little
bit:
for field in self.table:
if not field.name in fields and field.writable==False:
if record_id:
fields[field.name] = self.record[field.name]
elif self.table[field.name].default!=None:
fields[field.name] = self.table[field.name].default
why is it checking writable==False? shouldn't it test for
writable==True or do I get something wrong here?
Alex