pyramid_cubicweb/core.py
changeset 11566 59548227ecc9
parent 11560 1a816189ceee
child 11568 a9940c6cd693
equal deleted inserted replaced
11565:6398be12f8e6 11566:59548227ecc9
   183     def _get_status_out(self):
   183     def _get_status_out(self):
   184         return self._request.response.status_int
   184         return self._request.response.status_int
   185 
   185 
   186     status_out = property(_get_status_out, _set_status_out)
   186     status_out = property(_get_status_out, _set_status_out)
   187 
   187 
       
   188     @property
       
   189     def message(self):
       
   190         """Returns a '<br>' joined list of the cubicweb current message and the
       
   191         default pyramid flash queue messages.
       
   192         """
       
   193         return u'\n<br>\n'.join(
       
   194             self._request.session.pop_flash()
       
   195             + self._request.session.pop_flash('cubicweb'))
       
   196 
       
   197     def set_message(self, msg):
       
   198         self.reset_message()
       
   199         self._request.session.flash(msg, 'cubicweb')
       
   200 
       
   201     def set_message_id(self, msgid):
       
   202         self.reset_message()
       
   203         self.set_message(
       
   204             self._request.session.pop(msgid, u''))
       
   205 
       
   206     def reset_message(self):
       
   207         self._request.session.pop_flash('cubicweb')
       
   208 
   188 
   209 
   189 def render_view(request, vid, **kwargs):
   210 def render_view(request, vid, **kwargs):
   190     """ Helper function to render a CubicWeb view.
   211     """ Helper function to render a CubicWeb view.
   191 
   212 
   192     :param request: A pyramid request
   213     :param request: A pyramid request