Thank you for your answer villas!

I don't think that is the problem. I am able to make inserts through
the appadmin-site, but somehow it fails with form.accepts().
I also tried what you suggested, but could not quite get it working.

On Feb 12, 8:45 pm, villas <[email protected]> wrote:
> Not sure, but the 3rd attrib of 'IS_IN_DB' doesn't look right?
>
> Maybe if you tried something like this, e.g.
> custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,'%
> (name)s')
>
> On Feb 12, 1:28 pm, Oskari <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi!
>
> > I'm having trouble making an insert with form.accepts()
>
> > Currently I have a custom auth_user that has one extra field:
> > Field('accountID', db.accounts) with
> > custom_auth_table.accountID.requires = IS_IN_DB(db,db.accounts.id,id)
>
> > While trying to modify variables it fails with "not found in db"
>
> > def func():
> >     form=SQLFORM(db.auth_user)
> >     request.vars.accountID = 1
> >     if form.accepts(request.vars,session):
> >         response.flash = "Succesfully created user"
> >     return dict(form=form)
>
> > Why does not form.accepts() recognize and accept my accountID?

Reply via email to