Thanks to everybody for fixing this!
You might also want to make a similar change at about line 244:
try:
field = sqlrows.db[tablename][fieldname]
# except KeyError:
except (KeyError,AttributeError):
field = None
On Monday, October 8, 2012 2:15:58 PM UTC-6, Massimo Di Pierro wrote:
:-)
>
> On Monday, 8 October 2012 12:53:27 UTC-5, Don_X wrote:
>>
>> BINGO ! - IT WORKS LIKE A CHARM MASSIMO !!! ...
>>
>> Thank you ... now I can study this properly so I can adapt it to my app !
>>
>> On Monday, October 8, 2012 1:49:09 PM UTC-4, Massimo Di Pierro wrote:
>>>
>>> Now the error is at a different line. The previous error has been fixed.
>>> Now it is at line 215:
>>>
>>>
>>> try:
>>> _id = record[keycolumntbl][keycolumnfld]
>>> except KeyError:
>>>
>>>
>>> as before it should be
>>>
>>> try:
>>> _id = record[keycolumntbl][keycolumnfld]
>>> except (KeyError, AttributeError):
>>>
>>>
>>>
>>> On Monday, 8 October 2012 12:39:09 UTC-5, Don_X wrote:
>>>>
>>>> For a more detailed report .. I have openned up the last line
>>>> pertaining to the plugin_powertable.py below :
>>>>
>>>>
>>>>
>>>> -
>>>> Function argument list
>>>>
>>>> ()
>>>>
>>>> Code listing
>>>>
>>>>
>>>>
>>>> 20.
>>>> 21.
>>>> 22.
>>>> 23.
>>>> 24.
>>>> 25.
>>>>
>>>> 26.
>>>> 27.
>>>> 28.
>>>> 29.
>>>>
>>>> table.showkeycolumn = False
>>>> table.extra = dict(
>>>>
>>>> details={'detailscallback':URL('myfunction.load')}
>>>> )
>>>>
>>>> table = table.create()
>>>>
>>>>
>>>> return locals()
>>>>
>>>> Variables
>>>>
>>>> table<Storage {'keycolumn': 'product.id', 'extra': {
>>>> '...te': <function plugin_powertable at 0xa762e144>}>table.create<
>>>> function plugin_powertable>
>>>> -
>>>>
>>>> *File /home/www-data/web2py/applications/powertable/
>>>> models/plugin_powertable.py in plugin_powertable at line 811*
>>>> code
>>>> arguments
>>>> variables
>>>> Function argument list
>>>>
>>>>
>>>> ()
>>>> Code listing
>>>>
>>>> 806.
>>>> 807.
>>>> 808.
>>>> 809.
>>>> 810.
>>>> 811.
>>>>
>>>> 812.
>>>> 813.
>>>> 814.
>>>> 815.
>>>>
>>>> ifunctions=str(ifunctions),
>>>>
>>>> searchcolumnjs=str(searchcolumnjs)
>>>> )
>>>> ),
>>>> CSS,
>>>> PowerTable(),
>>>>
>>>> )
>>>>
>>>>
>>>> plugins.powerTable.create = plugin_powertable
>>>>
>>>> Variables
>>>> global PowerTable<class '__restricted__.PowerTable'>
>>>> -
>>>>
>>>>
>>>> *File /home/www-data/web2py/applications/powertable/
>>>> models/plugin_powertable.py in __init__ at line 215*
>>>> code
>>>> arguments
>>>> variables
>>>>
>>>> Function argument list
>>>>
>>>>
>>>> (self=<__restricted__.PowerTable object>)
>>>> Code listing
>>>>
>>>>
>>>>
>>>> 210.
>>>> 211.
>>>> 212.
>>>> 213.
>>>> 214.
>>>> 215.
>>>>
>>>> 216.
>>>> 217.
>>>> 218.
>>>> 219.
>>>>
>>>> else:
>>>> _title = T('Record %s' % str(rc+1))
>>>>
>>>> #setting the id and key for every <tr> based on required
>>>> keycolumn
>>>> try:
>>>> _id = record[keycolumntbl][keycolumnfld]
>>>>
>>>> except KeyError:
>>>> if virtualfields:
>>>> _id = record[sqlrows.colnames[0].split('.')[0]].id
>>>> else:
>>>>
>>>>
>>>> Variables
>>>>
>>>> record<Row {'description': 'LCD TV', 'quantity': 34, '...ter
>>>> object at 0xa757f98c>, 'name': 'Television'}>_idundefined
>>>> keycolumntbl'product'keycolumnfld'id'
>>>> -
>>>>
>>>> *File /home/www-data/web2py/gluon/dal.py in __getitem__
>>>> at line 6376*
>>>> code
>>>> arguments
>>>> variables
>>>> Function argument list
>>>>
>>>>
>>>> (self=<Row {'description': 'LCD TV', 'quantity': 34,
>>>> '...ter object at 0xa757f98c>, 'name': 'Television'}>,
>>>> key='product')
>>>> Code listing
>>>>
>>>> 6371.
>>>> 6372.
>>>> 6373.
>>>> 6374.
>>>> 6375.
>>>> 6376.
>>>>
>>>> 6377.
>>>> 6378.
>>>> 6379.
>>>> 6380.
>>>>
>>>> elif m:
>>>> try:
>>>> return ogetattr(self, m.group(1))[m.group(2)]
>>>> except (KeyError,AttributeError,TypeError):
>>>> key = m.group(2)
>>>> return ogetattr(self, key)
>>>>
>>>>
>>>> def __setitem__(self, key, value):
>>>> setattr(self, str(key), value)
>>>>
>>>> Variables
>>>> self<Row {'description': 'LCD TV', 'quantity': 34,
>>>> '...ter
>>>> object at 0xa757f98c>, 'name': 'Television'}>global ogetattr<slot
>>>> wrapper '__getattribute__' of 'object' objects>key'product'
>>>>
>>>>
>>>>
>>>>
--