web/controller.py
branchstable
changeset 9229 739ae5366bed
parent 8697 574bb05e40a4
child 10663 54b8a1f249fb
equal deleted inserted replaced
9228:90b8c7a7e205 9229:739ae5366bed
     1 # copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     1 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
     3 #
     3 #
     4 # This file is part of CubicWeb.
     4 # This file is part of CubicWeb.
     5 #
     5 #
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
     6 # CubicWeb is free software: you can redistribute it and/or modify it under the
    19 
    19 
    20 __docformat__ = "restructuredtext en"
    20 __docformat__ = "restructuredtext en"
    21 
    21 
    22 from logilab.mtconverter import xml_escape
    22 from logilab.mtconverter import xml_escape
    23 from logilab.common.registry import yes
    23 from logilab.common.registry import yes
       
    24 from logilab.common.deprecation import deprecated
    24 
    25 
    25 from cubicweb.appobject import AppObject
    26 from cubicweb.appobject import AppObject
    26 from cubicweb.mail import format_mail
    27 from cubicweb.mail import format_mail
    27 from cubicweb.web import LOGGER, Redirect, RequestError
    28 from cubicweb.web import LOGGER, Redirect, RequestError
    28 
    29 
   101         #       rest_path() could rely on schema constraints (such as a required
   102         #       rest_path() could rely on schema constraints (such as a required
   102         #       relation) that might not be satisfied yet (in case of creations)
   103         #       relation) that might not be satisfied yet (in case of creations)
   103         if not self._edited_entity:
   104         if not self._edited_entity:
   104             self._edited_entity = entity
   105             self._edited_entity = entity
   105 
   106 
       
   107     @deprecated('[3.18] call view.set_http_cache_headers then '
       
   108                 '.is_client_cache_valid() method and return instead')
   106     def validate_cache(self, view):
   109     def validate_cache(self, view):
   107         view.set_http_cache_headers()
   110         view.set_http_cache_headers()
   108         self._cw.validate_cache()
   111         self._cw.validate_cache()
   109 
   112 
   110     def sendmail(self, recipient, subject, body):
   113     def sendmail(self, recipient, subject, body):