Thanks for your reply. I tried:
>
> def mycompute(r):
> print 'In mycompute(r), r = ' + r
> return str(r['selector']) + ' ' + str(r['property'])
>
> db.define_table('css_selectorproperty',
> Field('selector',length=48,default='',notnull=True),
> Field('property',length=36,default='',notnull=True),
>
> Field('name',length=84,default='',notnull=True,compute=mycompute,writable=False,readable=False),
> migrate=False)
>
> Then check the shell window for messages?
But that didn't result in a message in the shell window. Changing the
code to:
def mycompute(r):
print 'In mycompute(r), r = ' + str(r)
return r
db.define_table('css_selectorproperty',
Field('selector',length=48,default='',notnull=True),
Field('property',length=36,default='',notnull=True),
Field('name',length=84,default='',notnull=True,compute=mycompute(lambda
r: str(r['selector']) + ' ' +
str(r['property'])),writable=False,readable=False),
migrate=False)
... resulted in the following message:
In mycompute(r), r = <function <lambda> at 0x6812030>
In mycompute(r), r = <function <lambda> at 0x6812f30>
In mycompute(r), r = <function <lambda> at 0x6691bf0>
In mycompute(r), r = <function <lambda> at 0x68098f0>
In mycompute(r), r = <function <lambda> at 0x6511ef0>
In mycompute(r), r = <function <lambda> at 0x6809b70>
In mycompute(r), r = <function <lambda> at 0x69d4070>
In mycompute(r), r = <function <lambda> at 0x65abd70>
In mycompute(r), r = <function <lambda> at 0x4d3acb0>
... which got me puzzled, why nine times In mycompute(r), r = ....
and still doesn't give me a clue of why the code doesn't work. I hope
it provides you with sufficient information to help me solve the
problem.
Kind regards,
Annet.