本文整理汇总了Python中Products.Five.browser.BrowserView类的典型用法代码示例。如果您正苦于以下问题:Python BrowserView类的具体用法?Python BrowserView怎么用?Python BrowserView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BrowserView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, context, request):
BrowserView.__init__(self, context, request)
self.catalog = getToolByName(self.context, 'portal_catalog')
self.wftool = getToolByName(self.context, 'portal_workflow')
pprops = getToolByName(self.context, 'portal_properties')
self.properties = pprops.realestatebroker_properties
self.plone_utils = getToolByName(self.context, 'plone_utils')
示例2: __init__
def __init__(self, context, request):
BrowserView.__init__(self, context, request)
self.title = _("Load Setup Data")
self.description = _("Please.")
self.text = _("")
# dependencies to resolve
self.deferred = {}
示例3: __init__
def __init__(self, context, request):
""" set up a few convenience object attributes """
BrowserView.__init__(self, context, request)
self.catalog = getToolByName(self.context, 'portal_catalog')
self.portal_url = getToolByName(self.context, 'portal_url')()
self.context_path = '/'.join(self.context.getPhysicalPath())
示例4: __init__
def __init__(self, context, request):
BrowserView.__init__(self, context, request)
self.membership = getToolByName(self.context, 'portal_membership')
self.catalog = getToolByName(self.context, 'portal_catalog')
self.portal_url = getToolByName(self.context, 'portal_url')()
self.context_path = '/'.join(self.context.getPhysicalPath())
示例5: __init__
def __init__(self, context, request):
BrowserView.__init__(self, context, request)
self.title = _("Load Setup Data")
self.description = _("Submit a valid Open XML (.XLSX) file containing Bika setup records to continue.")
# dependencies to resolve
self.deferred = {}
self.request.set("disable_border", 1)
示例6: __init__
def __init__(self, context, request):
BrowserView.__init__(self, context, request)
self.acl_users = getToolByName(context, 'acl_users')
self.sgm_data = api.portal.get_registry_record(
'sgm_data', interface=ISimpleGroupManagementSettings
)
self.never_used_groups = api.portal.get_registry_record(
'sgm_never_managed_groups', interface=ISimpleGroupManagementSettings
)
示例7: __init__
def __init__(self, context, request):
""" set up a few convenience object attributes """
BrowserView.__init__(self, context, request)
self.catalog = getToolByName(self.context, "portal_catalog")
self.actionTool = getToolByName(self.context, "portal_actions")
self.portal_url = getToolByName(self.context, "portal_url")()
self.context_path = "/".join(self.context.getPhysicalPath())
示例8: __init__
def __init__(self, context, request):
"""Override BrowserView's __init__ to create the ListUsersForm
for later use.
"""
BrowserView.__init__(self, context, request)
self.form_wrapper = ListUsersFormWrapper(self.context, self.request)
self.form_wrapper.form_instance = ListUsersForm(
self.context, self.request
)
示例9: __init__
def __init__(self, context, request):
BrowserView.__init__(self, context, request)
self.saveRequest = {}
self.addRequest = {}
self.confirmMessage = ''
# will be {action_id: {data}, ...}
self.errs = {}
self.portal_actions = getToolByName(context, 'portal_actions')
self.translation_service = getToolByName(context, 'translation_service')
self.plone_utils = getToolByName(context, 'plone_utils')
示例10: __init__
def __init__(self, context, request):
''' '''
BrowserView.__init__(self, context, request)
SequenceTable.__init__(self, context, request)
self.criteria = ICriteria(self.context)
view = queryMultiAdapter((self.context, self.request), name=u'faceted_query')
self.query = view.criteria()
self.sorting_criterion_name = self._sortingCriterionName()
# convenience
self.portal = api.portal.get()
self.portal_url = self.portal.absolute_url()
示例11: __init__
def __init__(self, context, request):
BrowserView.__init__(self, context, request)
#dependencies
self.plone_tools_loaded = False
self.portal_url = None
self.membrane_tool = None
self.membership = None
self.memberid = None
self.member = None
self.url = None
self.fullname = None
示例12: __init__
def __init__(self, *args, **kwargs):
""" Get the virtual path of the requested file or folder from
the GET form.
Sets the following variables:
self.basepath:
The path configured by the manager for this
FilesystemFolder.
self.requestedPath:
The path requested by the user.
self.requestedDir:
The directory part of the path requested by the user.
self.requestedDir:
self.basename:
The last component of self.requestedPath.
self.dirpath:
The absolute path to the requested directory on disk.
self.filepath:
The absolute path to the requested file on disk. Is None if the
requested object is a directory.
"""
BrowserView.__init__(self, *args, **kwargs)
self.ctx = aq_inner(self.context)
self.basepath = self.ctx.getPath()
requestedPath = self.request.form.get("path", "")
if requestedPath:
basename = requestedPath.split("/")[-1]
path = join(self.basepath, requestedPath.replace("/", sep))
if not exists(path):
IStatusMessage(self.request).addStatusMessage(
"Invalid path: %s. Redirected to rootdirectory." % requestedPath,
type='error')
path = self.basepath
requestedPath = ""
else:
path = self.basepath
basename = self.ctx.Title()
self.requestedPath = requestedPath
if path.endswith("/"):
path = path[:-1]
if isdir(path):
self.filepath = None
self.dirpath = path
else:
self.filepath = path
self.dirpath = dirname(path)
requestedDir = "/".join(requestedPath.split("/")[:-1])
FsItem.__init__(self, requestedDir, basename, isDir=isdir(path))
示例13: __init__
def __init__(self, context, request, form):
BrowserView.__init__(self, context, request)
self.form = form
# We may have data already...
try:
self.form.data = self.form.submission.retrieve(form, self.context)
except:
for key in context.formdefaults.keys():
try:
self.form.data.getField(key).value = context.formdefaults[key]
except:
pass
示例14: __init__
def __init__(self, context, request):
BrowserView.__init__(self, context, request)
# del portlet de calendar
calendar_render.update(self)
self.utils = getMultiAdapter((self.context, self.request), name=u"upc.genweb.utils")
self.now = localtime()
# del portlet de events
portal_state = getMultiAdapter((self.context, self.request), name=u"plone_portal_state")
self.portal_url = portal_state.portal_url()
self.portal = portal_state.portal()
self.have_events_folder = "esdeveniments" in self.portal.objectIds()
示例15: __getattribute__
def __getattribute__(self, name):
if name == "member_fields":
return BrowserView.__getattribute__(self, name)
if name in self.member_fields:
if self.memberid is None:
raise ValueError("memberid can't be none")
membrane = self.get_membrane()
if membrane is None:
return None
pref = '%s%s' % (NAMESPACE, name)
if not getattr(membrane, pref, False):
return getattr(membrane, name)
else:
return ""
else:
return BrowserView.__getattribute__(self, name)