What's the best way to pass a Python list back to the controller, i.e. keep the list object persistent between calls? The list could get quite large so I'm not sure if request.args or request.vars is appropriate for it (well the items in the list)? The code below is a mockup of what I'm trying to achieve. The list in question is 'serials.'
@auth.requires_login() def send(): """ Method for 'sending'an IBC tote to a location. """ try: if serials: pass except: serials = list() if request.vars["location_id"]: if request.vars["serial_number"]: # update the location serials.append(request.vars["serial_number"]) # start accepting input to update IBC's to this location status = "Location: " + db.MyLocation[request.vars['location_id']]. name form = SQLFORM.factory(Field('Object_serial_number', requires= IS_IN_DB(db, 'Object.serial_number', '%(serial_number)s', orderby=db.Object. serial_number))) if form.process().accepted: response.flash = form.vars.Object_serial_number redirect(URL('send', vars=dict(location_id=request.vars[ "location_id"], serial_number=form.vars.Object_serial_number))) else: # we need to pick a location form = SQLFORM.factory(Field('send_location', requires=IS_IN_DB(db, 'MyLocation.id', '%(name)s', orderby=db.MyLocation.name))) if form.process().accepted: response.flash = form.vars.send_location redirect(URL('send', vars=dict(location_id=form.vars. send_location))) status = "No location" return dict(grid=form, status=status, serials=serials, count=len(serials )) Basically, the user goes to the 'send' controller, picks a location, then enters serial numbers. I'd like to keep a list going so that the user can remove a serial number from the list if they added one in error and then submit them for updating all at once. -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.