I reported the same thing in this thread:
http://groups.google.com/group/web2py/browse_thread/thread/280f6b746e2b7201
-Jim
On 1/21/2012 4:00 PM, Alan Etkin wrote:
I recently updated my web2py source code from the mercurial repository
I think that something has changed in SQLFORM that is incompatible
with custom id field names declared with:
Field("other_id", ...)
On form processing, record updates stop the app with this error:
Traceback (most recent call last):
File "/home/alan/gestionlibre/gestionlibre_gui-hg/controllers/
appadmin.py", line 178, in update
if session.form.accepts(evt.args, formname=None, keepvalues=False,
dbio=False):
File "/home/alan/web2py-hg/gluon/sqlhtml.py", line 1050, in accepts
(formname_id, record_id) = (self.record[id_fieldname],
File "/home/alan/web2py-hg/gluon/dal.py", line 4987, in __getitem__
return dict.__getitem__(self, key)
I managed to solve the problem for updates by changing sqlhtml.py in
this way:
(Line 1039)
# retrieve the actual id name (for legacy databases)
try:
id_fieldname = self.table.id.name
except (IndexError, AttributeError):
# could not retrieve the table id value
id_fieldname = "id"
# former notation was self.record.id Check for
compatibility
(formname_id, record_id) = (self.record[id_fieldname],
request_vars.get('id',
None))
The problem seems to be related to SQLFORM trying to get the default
id key from table records, and may reproduce in other instances, since
I see that the record.id property is being called in other sections of
the module.
I'd continue with the fix to provide a complete modification of the
module if the solution provided has no backward compatibility or other
problems.
Thanks
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4757 - Release Date: 01/21/12
--
Jim Steil
VP of Information Technology
Quality Liquid Feeds, Inc.
608.935.2345 office
608.341.9896 cell