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/install/BaseInstall.py

    r1505 r1585  
    130130 
    131131        self.page_msg = PageMessages(self.context) 
    132         self.context["page_msg"] = self.page_msg 
    133  
    134         # Redirect every "warning" messages into context["page_msg"]: 
    135         redirect_warnings(self.context["page_msg"]) 
     132        self.request.page_msg = self.page_msg 
     133 
     134        # Redirect every "warning" messages into request.page_msg: 
     135        redirect_warnings(self.request.page_msg) 
    136136 
    137137    #___________________________________________________________________________ 
     
    145145 
    146146        if msg and msg != "": # insert the messages: 
    147             self.context["page_msg"].write(msg) 
     147            self.request.page_msg.write(msg) 
    148148 
    149149        return render_to_response( 
     
    172172            # Cookie is not set or the salt hash value compair failed 
    173173            if DEBUG: 
    174                 self.context["page_msg"].write("DEBUG: %s" % msg) 
     174                self.request.page_msg.write("DEBUG: %s" % msg) 
    175175        else: 
    176176            # access ok -> start the normal _install view() method 
     
    190190                except WrongPassword, msg: 
    191191                    # Display the form again 
    192                     self.context["page_msg"].write(msg) 
     192                    self.request.page_msg.write(msg) 
    193193                else: 
    194194                    # Password is ok. -> process the normal _instal view() 
     
    205205 
    206206        self.context["no_menu_link"] = True # no "back to menu" link 
    207 #        self.context["page_msg"].write(_("Please input the password")) 
     207#        self.request.page_msg.write(_("Please input the password")) 
    208208        return render_to_response("install_login.html", self.context) 
    209209