Exemplo n.º 1
0
 def index_html(self):
     """ Allow creation of .
     """
     if 'index_html' in self:
         return self._getOb('index_html')
     request = getattr(self, 'REQUEST', None)
     if request and 'REQUEST_METHOD' in request:
         if (request.maybe_webdav_client
                 and request['REQUEST_METHOD'] in ['PUT']):
             # Very likely a WebDAV client trying to create something
             nr = NullResource(self, 'index_html')
             nr.__replaceable__ = REPLACEABLE
             return nr
     return None
 def index_html(self):
     """ Allow creation of .
     """
     if 'index_html' in self:
         return self._getOb('index_html')
     request = getattr(self, 'REQUEST', None)
     if request and 'REQUEST_METHOD' in request:
         if (request.maybe_webdav_client and
                 request['REQUEST_METHOD'] in ['PUT']):
             # Very likely a WebDAV client trying to create something
             nr = NullResource(self, 'index_html')
             nr.__replaceable__ = REPLACEABLE
             return nr
     return None
Exemplo n.º 3
0
 def index_html(self, REQUEST=None, RESPONSE=None):
     """ Special case index_html """
     if 'index_html' in self:
         return self._getOb('index_html')
     request = REQUEST
     if request is None:
         request = getattr(self, 'REQUEST', None)
     if request and 'REQUEST_METHOD' in request:
         if request.maybe_webdav_client:
             method = request['REQUEST_METHOD']
             if method == 'PUT':
                 # Very likely a WebDAV client trying to create something
                 nr = NullResource(self, 'index_html')
                 nr.__replaceable__ = REPLACEABLE
                 return nr
             elif method in ('GET', 'HEAD', 'POST'):
                 # Do nothing, let it go and acquire.
                 pass
             else:
                 raise AttributeError('index_html')
     # Acquire from parent
     parent = aq_parent(aq_inner(self))
     target = parent.aq_acquire('index_html')
     return ReplaceableWrapper(target).__of__(parent).__of__(self)