I´m working on a new application which I created with the online wizard. I just created a new record and then updated it via those crud forms which are created for all tables.

This tabel was created by hand by editing the database models file and then I copied those crud forms too.

But when I now tried to update that record I got this error ticket. There is a copy of the relevant part of the my database models file.

Apache, mod_wsgi, MySQL


Kenneth


xxxxxxxx.2011-01-12.12-33-23.f900b81c-a5d5-45ac-8fcc-88b3bc0c3589
Version
web2py™ Version 1.91.6 (2011-01-03 17:55:14)
Python Python 2.6.5: /usr/bin/python
Traceback

Traceback (most recent call last):
File "/data/domains/web2py/gluon/restricted.py", line 188, in restricted
exec ccode in environment
File "/data/domains/web2py/applications/kenneths/controllers/stuff.py", line 162, in <module>
File "/data/domains/web2py/gluon/globals.py", line 95, in <lambda>
self._caller = lambda f: f()
File "/data/domains/web2py/gluon/tools.py", line 2297, in f
return action(*a, **b)
File "/data/domains/web2py/applications/kenneths/controllers/stuff.py", line 49, in payment_receiver_update
onaccept=crud.archive)
File "/data/domains/web2py/gluon/tools.py", line 2860, in update
callback(onaccept,form,table._tablename)
File "/data/domains/web2py/gluon/tools.py", line 50, in callback
[action(form) for action in actions]
File "/data/domains/web2py/gluon/tools.py", line 2757, in archive
id = archive_table.insert(**new_record)
File "/data/domains/web2py/gluon/dal.py", line 3875, in insert
return self._db._adapter.insert(self,self._listify(fields))
File "/data/domains/web2py/gluon/dal.py", line 704, in insert
raise e
InternalError: (1054, u"Unknown column 'f_address' in 'field list'")

Error snapshot help Detailed traceback description

<class 'gluon.contrib.pymysql.err.InternalError'>((1054, u"Unknown column 'f_address' in 'field list'"))

inspect attributes
Exception instance attributes
__module__ 'gluon.contrib.pymysql.err'
__getslice__ <method-wrapper '__getslice__' of InternalError object>
__str__ <method-wrapper '__str__' of InternalError object>
__getattribute__ <method-wrapper '__getattribute__' of InternalError object>
__dict__ {}
__sizeof__ <built-in method __sizeof__ of InternalError object>
__weakref__ None
__init__ <method-wrapper '__init__' of InternalError object>
__setattr__ <method-wrapper '__setattr__' of InternalError object>
__reduce_ex__ <built-in method __reduce_ex__ of InternalError object>
__new__ <built-in method __new__ of type object>
__format__ <built-in method __format__ of InternalError object>
__class__ <class 'gluon.contrib.pymysql.err.InternalError'>
__doc__ 'Exception raised when the database encounters an...anymore, the transaction is\n out of sync, etc.'
__getitem__ <method-wrapper '__getitem__' of InternalError object>
__setstate__ <built-in method __setstate__ of InternalError object>
__reduce__ <built-in method __reduce__ of InternalError object>
args (1054, u"Unknown column 'f_address' in 'field list'")
__subclasshook__ <built-in method __subclasshook__ of type object>
__unicode__ <built-in method __unicode__ of InternalError object>
__delattr__ <method-wrapper '__delattr__' of InternalError object>
__repr__ <method-wrapper '__repr__' of InternalError object>
__hash__ <method-wrapper '__hash__' of InternalError object>

Function argument list

(self=<gluon.dal.MySQLAdapter object>, table=<Table {'current_record': <gluon.dal.Field objec...te': <gluon.dal.Field object at 0x2aaab020bc90>}>, fields=[(<gluon.dal.Field object>, 'Suomi Communications Oy'), (<gluon.dal.Field object>, '157230-403873'), (<gluon.dal.Field object>, 'Upseerinkatu 3 A'), (<gluon.dal.Field object>, '02600'), (<gluon.dal.Field object>, 'Espoo'), (<gluon.dal.Field object>, 'lasku...@suomicom.fi'), (<gluon.dal.Field object>, 'www.suomicom.fi'), (<gluon.dal.Field object>, '1713769-5'), (<gluon.dal.Field object>, True), (<gluon.dal.Field object>, datetime.datetime(2011, 1, 12, 12, 28, 44)), (<gluon.dal.Field object>, datetime.datetime(2011, 1, 12, 12, 28, 44)), (<gluon.dal.Field object>, 1), (<gluon.dal.Field object>, 1), (<gluon.dal.Field object>, 3L)])
Code listing


try:
self.execute(query)
except Exception, e:
if isinstance(e,self.integrity_error_class()):
return None
raise e

if hasattr(table,'_primarykey'):
return dict( [ (k,fields[k]) for k in table._primarykey ])
id = self.lastrowid(table)
if not isinstance(id,int):

Variables
e InternalError(1054, u"Unknown column 'f_address' in 'field list'")


########################################
db.define_table('t_payment_receiver',
Field('id','id',
represent=lambda id:SPAN(id,' ',A('view',_href=URL('payment_receiver_read',args=id)))),
Field('f_name', type='string',
label=T('Name')),
Field('f_bank_account', type='string',
label=T('Bank account')),
Field('f_address', type='string',
label=T('Address')),
Field('f_zip_code', type='string',
label=T('Zip Code')),
Field('f_city', type='string',
label=T('City')),
Field('f_email', type='string',
label=T('Email')),
Field('f_website', type='string',
label=T('Website')),
Field('f_business_id', type='string',
label=T('Business ID')),
Field('active','boolean',default=True,
label=T('Active'),writable=False,readable=False),
Field('created_on','datetime',default=request.now,
label=T('Created On'),writable=False,readable=False),
Field('modified_on','datetime',default=request.now,
label=T('Modified On'),writable=False,readable=False,
update=request.now),
Field('created_by',db.auth_user,default=auth.user_id,
label=T('Created By'),writable=False,readable=False),
Field('modified_by',db.auth_user,default=auth.user_id,
label=T('Modified By'),writable=False,readable=False,
update=auth.user_id),
format='%(f_name)s',
migrate=settings.migrate)

Reply via email to