Future standard GUI library

Frank Millman frank at chagford.com
Fri Jun 14 05:36:19 EDT 2013


"Chris Angelico" <rosuav at gmail.com> wrote in message 
news:CAPTjJmq_m4y0UXXt3JqYThJj9CKbsvp+Z2PGF5v_31xLrgfr4Q at mail.gmail.com...
> On Fri, Jun 14, 2013 at 3:39 PM, Frank Millman <frank at 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






More information about the Python-list mailing list