Commit c42fe607 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

no longer use legacy API in WebSite.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43759 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6dc4fa27
...@@ -35,6 +35,7 @@ from Products.ERP5Type.Globals import get_request ...@@ -35,6 +35,7 @@ from Products.ERP5Type.Globals import get_request
from Persistence import Persistent from Persistence import Persistent
from ZPublisher import BeforeTraverse from ZPublisher import BeforeTraverse
from ZPublisher.HTTPRequest import HTTPRequest from ZPublisher.HTTPRequest import HTTPRequest
from warnings import warn
WEBSITE_KEY = 'web_site_value' WEBSITE_KEY = 'web_site_value'
WEBSITE_LANGUAGE_KEY = 'web_site_language' WEBSITE_LANGUAGE_KEY = 'web_site_language'
...@@ -163,7 +164,7 @@ class WebSite(WebSection): ...@@ -163,7 +164,7 @@ class WebSite(WebSection):
return self return self
# Static Language Selection support # Static Language Selection support
def _getExtensibleContent(self, request, name): def getExtensibleContent(self, request, name):
language_list = self.getAvailableLanguageList() language_list = self.getAvailableLanguageList()
if language_list and self.isStaticLanguageSelection(): if language_list and self.isStaticLanguageSelection():
# Interprete names which could be a language # Interprete names which could be a language
...@@ -176,6 +177,14 @@ class WebSite(WebSection): ...@@ -176,6 +177,14 @@ class WebSite(WebSection):
return self.asContext(id=name) return self.asContext(id=name)
return WebSection.getExtensibleContent(self, request, name) return WebSection.getExtensibleContent(self, request, name)
def _getExtensibleContent(self, request, name):
"""
Legacy API
"""
warn("_getExtensibleContent() function is deprecated. Use getExtensibleContent() instead.", \
DeprecationWarning, stacklevel=2)
return self.getExtensibleContent(request, name)
# Virtual Hosting Support # Virtual Hosting Support
security.declarePrivate( 'manage_beforeDelete' ) security.declarePrivate( 'manage_beforeDelete' )
def manage_beforeDelete(self, item, container): def manage_beforeDelete(self, item, container):
......
...@@ -40,7 +40,7 @@ class ExtensibleTraversableMixIn: ...@@ -40,7 +40,7 @@ class ExtensibleTraversableMixIn:
except KeyError: except KeyError:
pass pass
document = self._getExtensibleContent(request, name) document = self.getExtensibleContent(request, name)
if document is not None: if document is not None:
return aq_base(document).__of__(self) return aq_base(document).__of__(self)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment