OK, I think I solved my own problem through trial and error. It seems
I was defining db in two different model files, so some of the default
tables weren't usable. I'm new to web2py, so still figuring out the
basics!

On Aug 27, 4:16 pm, monotasker <[email protected]> wrote:
> Hi. I'm trying to create a table in a model that users db.user_auth as
> an external key in one of the fields. But whenever I add db.auth to
> the table definition it generates a "key" error compaining about
> "user_auth".
>
> Here's the section of the model that throws the error:
>
> db.define_table('question_records',
>     Field('user', db.user_auth),
>     Field('question', db.questions),
>     Field('last_right', 'date', default=request.now),
>     Field('last_wrong', 'date', default=request.now),
>     Field('times_right'),
>     Field('times_wrong'),
>     Field('category')
>     )
>
> Any idea why this isn't working?
>
> Thanks

Reply via email to