Module ImportFrom alias Import alias Expr Str ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad If NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameStore AttributeLoad NameLoad attr orelse Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body TryExcept body If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad handlers ExceptHandler type NameLoad name NameStore body Pass Return NameLoad decorator_list decorator_list Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Return CompareEq AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list
N/A builtins object N/A os N/A 
This middleware manages the "editing" status of a Session. 

Views should not pay attention (nor modify) the "editing" key in request.GET and in request.session.
Views are supposed to call is_editing() to determine whether they should
render an editable version or not.

Internally, editing is activated by a GET editing=1, 
stopped explicitly by GET editing=0, or stopped automatically 
if the request.path changes. Editing is also "sticky", if theres no
"editing" key requested, then the previous request's value is 
maintained.


There can be more than one renderers in a single request. 
When a renderer says stop_editing(), then this should become 
active only for the next request, other renderers of the same 
request must still get True when they call is_editing().

If a renderer calls stop_editing() and some other renderer 
(before or after) calls continue_editing(), then editing continues.

Example: when a renderer saves successfully, then it calls stop_editing(). But if some other renderer detects a validation error, then it calls continue_editing() and this will override the stop call of the first renderer.

 EditingMiddleware N/A object N/A process_request N/A N/A self request N/A N/A N/A N/A request stop_editing False N/A N/A request continue_editing False N/A editing N/A N/A N/A request GET get editing None N/A N/A editing None N/A N/A editing N/A int editing N/A editing N/A N/A N/A N/A request session N/A editing path N/A request path N/A N/A N/A N/A request session N/A editing path None N/A process_response N/A N/A self request response N/A N/A N/A N/A N/A N/A N/A request stop_editing N/A N/A request continue_editing N/A N/A N/A N/A request session N/A editing None N/A N/A N/A AttributeError N/A e N/A N/A N/A response N/A N/A N/A         
[23/Apr/2009 09:48:36] "GET / HTTP/1.1" 200 4620
Traceback (most recent call last):
  File "l:\snapshot\django\django\core\serversasehttp.py", line 278, in run
    self.result = application(self.environ, self.start_response)
  File "l:\snapshot\django\django\core\serversasehttp.py", line 635, in __call__
    return self.application(environ, start_response)
  File "l:\snapshot\django\django\core\handlers\wsgi.py", line 245, in __call__
    response = middleware_method(request, response)
  File "c:\drives	\svnwork\lino	runk\src\lino\django\utils\editing.py", line 61, in process_response
    if request.stop_editing and not request.continue_editing:
AttributeError: 'WSGIRequest' object has no attribute 'stop_editing'        
 is_editing N/A N/A request N/A N/A N/A path N/A N/A N/A request session get editing None N/A N/A N/A request path path N/A stop_editing N/A N/A request N/A N/A N/A N/A request stop_editing True N/A continue_editing N/A N/A request N/A N/A N/A N/A request continue_editing True N/A