Anthony ... got it working, thanks for all of your help!! Best Regards, On Sunday, November 18, 2012 9:25:39 AM UTC-6, Anthony wrote:
> It's still not clear exactly what isn't working. > > @auth.requires_login() >> record = db(db.bike.bike_identifier != "").select()[0] >> assert(record != None) >> form = SQLFORM(db.bike, record, showid=False) >> # Default a form value >> #form.vars.bike_identifier = record.bike_identifier >> form.add_button("Cancel", URL("index")) >> *form.add_button("Print_Tag", URL("tagprint", >> args=record.bike_identifier)) >> * >> > > Have you verified whether record.bike_identifier contains a value and > whether the button does in fact end up pointing to a URL with that value as > an arg at the end of the URL? > > >> # Print completed tags >> ** >> @auth.requires_login() >> def tagprint(): >> Title = "For Sale" >> req = request.vars['bike_identifier'] >> * Rows = db(db.bike.bike_identifier==request.args(0)).select() >> * for row in Rows: >> bike_identifier = row.bike_identifier >> serial = row.serial >> make = row.make >> model = row.model >> size = row.size >> color = row.color >> style = row.style >> date_of_receipt = row.date_of_receipt >> repairs = row.repairs_done >> price = row.price >> return dict(Title=Title, req=req) >> > > I'm not sure what the problem is above. The only place you access > request.args(0) is in the definition of Rows, but your function never > returns anything from Rows, so how would you know whether request.args(0) > does in fact contain the value you expect it to have? Your function does > return req, but that is defined as request.vars['bike_identifier'], which > will be None because the request made to this function does not include any > vars. If you want 'bike_identifier' to be passed as a GET variable to the > tagprint function, then your URL() call in the first function should be: > > URL("tagprint", vars=dict(bike_identifier=record.bike_identifier)) > > Then you'll get a URL that looks like > /yourapp/default/tagprint?bike_identifier=[bike identifier value]. > > Anthony > --