Here's a couple of improvements to the code referenced in David's message:

In the definition of postId(), change this line:
        id = '%s%s' % (time.time(), random.random())
to:
        id = '%r%r' % (time.time(), random.random())
to avoid loss of precision.

And in isReposted(), add this as the second last line (just before "return 0"):

        self.application().sessions().storeSession(sess)

This ensures that your altered session data is committed to stable
storage right now, instead of at the end of the current
(possibly long-running) servlet.  This may or may not be necessary,
depending on your choice of SessionStore.


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to