Wow thanks for that check_reserved=['all'] tip, turns out I had a few
illegal names that weren't causing problems yet. I wonder why it's not
enabled by default.
On Saturday, December 1, 2012 2:01:17 PM UTC-8, David Tucker wrote:
>
> I'm editing my data model in db.py and trying to add a field to a table of
> accounts that groups them using a foreign key.
>
> Field('group', 'reference groups', ondelete='CASCADE',
> required=True, default=db(db.groups).select().first().id),
>
> causes a ticket that reads: and causes web2py to freeze
> (must force quit and reopen); however,
>
> Field('groupd', 'reference groups', ondelete='CASCADE',
> required=True, default=db(db.groups).select().first().id),
>
> works fine.
>
> Can someone explain why this is? Also, is there a better/more elegant way
> to specify a default for 'reference' types? Basically I want the default to
> be the first entry in the 'groups' table (which is a generic 'ungrouped'
> group).
>
> Thank you for any help, I'm a web2py noob coming from a PHP/MySQL
> background.
>
>
--