Alright :) it may be "not good looking" right now, but I'll gladly
post my novice web2py code :) Which parts would be useful?

thanks,
Mart :)



On Sep 27, 12:10 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> This
>
>    row = db.p4users_all(request.args(0))
>    form = SQLFORM(db.p4users_all, row, deletable=True)
>
> in your code should not create a new db.p4users_all unless row is
> None. Check the value of row. If it is none you are passing something
> wrong for request.args(0). Hard to tell without the rest of the code
> and/or an example.
>
> On Sep 27, 10:12 am, mart <msenecal...@gmail.com> wrote:
>
> > Hi
>
> > so, I have this table:
>
> > db.define_table('p4users',
> >                 SQLField('p4_user'),format='%(p4_user)s')
>
> > which gives me a nice dropdown :)
>
> > then I have this one, where I want to update the Status field.
>
> > db.define_table('p4users_all',
> >            SQLField('Name', db.auth_user, default=auth.user_id),
> > #           SQLField('User',db.p4users),
> >            SQLField('User_id',requires=IS_IN_DB(db,db.p4users.id,'%
> > (p4_user)s')),
> >            SQLField('Status',db.p4Status),
> >            SQLField('License',db.license))
>
> > in the controller, I have something like this  (i know a little messy,
> > but I am in a rush ... I have been grasping at this point ;) )
>
> > def display_form():
> > #   record = db.p4users_all(request.args(0))
> >    row = db.p4users_all[request.args(0)]
> >    form = SQLFORM(db.p4users_all, row, deletable=True)
> >    form.vars.id = request.vars.id
> >    if form.accepts(request.vars, session):
>
> >        response.flash = 'form accepted'
> >    elif form.errors:
> >        response.flash = 'form has errors'
> >    return dict(form=form)
>
> > Any help, would REALLY be appreciated! :)
>
> > Thahnnks,
> > Mart :)
>
> > How do I make so it doesn't create a new record every time I want to
> > update a user's status?
>
>

Reply via email to