"Chris Angelico" <ros...@gmail.com> wrote in message news:captjjmq_m4y0uxxt3jqythjj9ckbsvp+z2pgf5v_31xlrgf...@mail.gmail.com... > On Fri, Jun 14, 2013 at 3:39 PM, Frank Millman <fr...@chagford.com> wrote: >> >> In my case, it is either-or. I do not just do field-by-field validation, >> I >> do field-by-field submission. The server builds up a record of the data >> entered while it is being entered. When the user selects 'Save', it does >> not >> resend the entire form, it simply sends a message to the server telling >> it >> to process the data it has already stored. > > Ah, I see what you mean. What I was actually saying was that it's > mandatory to check on the server, at time of form submission, and > optional to pre-check (either on the client itself, for simple > syntactic issues, or via AJAX or equivalent) for faster response. > > As a general rule, I would be inclined to go with a more classic > approach for reasons of atomicity. What happens if the user never gets > around to selecting Save? Does the server have a whole pile of data > that it can't do anything with? Do you garbage-collect that > eventually? The classic model allows you to hold off inserting > anything into the database until it's fully confirmed, and then do the > whole job in a single transaction. >
The data is just stored in memory in a 'Session' object. I have a 'keep-alive' feature that checks if the client is alive, and removes the session with all its data if it detects that the client has gone away. Timeout is configurable, but I have it set to 30 seconds at the moment. The session is removed immediately if the user logs off. He is warned if there is unsaved data. Frank -- http://mail.python.org/mailman/listinfo/python-list