>
> ok, still trying new ideas.  this time i stored the prtype in a session 
> variable then did an onvalid function to pass the session.party value into 
> gform.vars.party, or:


def worksheet2b():
    cidi = args_to_int(0)
    sidi = args_to_int(1)
    gidi = mcp.request_to_int(request.vars.pr)
    prtype = "DEFAULT"
    if (request.vars.pr == "a"):
        prtype = "VALUE1"
    elif (request.vars.pr == "b"):
        prtype = "VALUE2"
    session.party = prtype
    if cidi and sidi:
        tCase = db.cases
        tSheet = db.case_worksheets
        tGross = db.sheet_gross_adjustments
        sCase = db(tCase.id==cidi).select().first()
        sSheet = db(tSheet.id==sidi).select().first()
        gform = SQLFORM(tGross, record=gidi)
        gform.vars.case_id = sCase.id
        gform.vars.case_worksheet_id = sSheet.id
        gform.vars.party = prtype
        if gform.process(onvalidation=chk_quick).accepted:
            session.flash = "Gross Adjustments Updated"
            redirect(URL(f="worksheet2a", args=[sCase.id,sSheet.id]))
        elif gform.errors:
            response.flash = "Gross Adjustment Errors"
    return dict(prtype=prtype, sCase=sCase, sSheet=sSheet, gform=gform)

def chk_quick(f):
    fv = f.vars
    fv.party = session.party
    return f

 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to