Show
Ignore:
Timestamp:
05/23/08 16:33:49 (22 months ago)
Author:
JensDiemer
Message:

new page_msg system. Use a middleware to make page_msg lazy: ticket:193

  • update settings_example.py (insert new middleware)
  • change """contextpage_msg?""" to """request.page_msg"""
  • add a simple page_msg unittest (Need more tests!)
  • update _install data (Templates and index page)
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/index.py

    r1583 r1585  
    9898    context = RequestContext(request) 
    9999 
    100     context["page_msg"] = PageMessages(context) 
     100    request.page_msg = PageMessages(context) 
    101101 
    102102    # Redirect every "warning" messages into the page_msg: 
    103     redirect_warnings(context["page_msg"]) 
     103#    redirect_warnings(request.page_msg) 
     104    redirect_warnings(request.page_msg) 
    104105 
    105106    context["PAGE"] = current_page_obj 
     
    122123 
    123124    # Add the context to the reponse object. 
    124     # Used in PyLucid.middlewares.additional_content 
     125    # Used in PyLucid middlewares 
    125126    request.CONTEXT = context 
     127 
     128    # TODO: remove Backwards-incompatible changes in >v0.8.5 
     129    msg = ( 
     130        'Error, see: <a href="' 
     131        'http://www.pylucid.org/_goto/121/changes/#20-05-2008-page_msg' 
     132        '">pylucid.org - Backwards-incompatible changes - page_msg</a>' 
     133    ) 
     134    context["messages"] = [mark_safe(msg)] 
    126135 
    127136    return context