How can I pass objects in a web page?

drs drs at remove-to-send-mail-ecpsoftware.com
Tue Sep 21 16:38:25 EDT 2004


"Cliff Wells" <clifford.wells at comcast.net> wrote in message
news:mailman.3606.1095716168.5135.python-list at python.org...
> On Mon, 2004-09-20 at 13:59 -0700, Brian Bull wrote:

* * *

> > passing the object from one static page to another via a
> > link.  Is this possible?
>
> The web, being stateless, usually requires that you "rebuild the world"
> with every mouse click.

Depending upon what the objects are like, python provides the pickle module
which allows for doing this without setting up a database.  Simply have the
first page embed a pickled object in a hidden input html tag that is sent
back to the server for the object inspection screen.  Not secure of course,
and conceivably very slow for large objects*, but pretty easy to do.

-d

* for large objects, dump them to a file on the server and return some
unique id instead of the whole object.





More information about the Python-list mailing list