That was simple. Feeling quite stupid that I missed it.
Thanks Anthony!
On Thursday, July 26, 2012 10:01:41 PM UTC+8, Anthony wrote:
>
> db.define_table('person',
>> Field('name','string',length=255,requires=IS_NOT_EMPTY()),
>> Field('location_id','reference location',default=location.id),
>> )
>>
>
> There is no "location" object defined anywhere, so location.id raises an
> exception. Perhaps you meant db.location.id, but that refers to the "id"
> Field object of the "location" table, so is not appropriate to specify as a
> default value (which must be an integer). From your code, it's not clear
> what an appropriate default woud be, if any.
>
> Anthony
>
>>
--