当前位置: 首页>>代码示例>>Python>>正文


Python BrowserView.__init__方法代码示例

本文整理汇总了Python中Products.Five.BrowserView.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BrowserView.__init__方法的具体用法?Python BrowserView.__init__怎么用?Python BrowserView.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Products.Five.BrowserView的用法示例。


在下文中一共展示了BrowserView.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
    def __init__(self, context, request):
        BrowserView.__init__(self, context, request)

        self.catalog = getToolByName(context, 'portal_catalog')
        portal_properties = getToolByName(context, 'portal_properties')
        self.fp = getattr(portal_properties, 'frontpage_properties')

        self.promotions = []
        self.portal_url = getToolByName(aq_inner(context), 'portal_url')()

        self.noOfHigh = self.fp.getProperty('noOfHigh', 3)
        self.noOfMedium = self.fp.getProperty('noOfMedium', 4)
        self.noOfLow = self.fp.getProperty('noOfLow', 10)
        self.noOfArticles = self.fp.getProperty('noOfArticles', 6)
        self.noOfNews = self.fp.getProperty('noOfNews', 6)
        self.noOfMultimedia = self.fp.getProperty(
                                                           'noOfMultimedia', 6)
        self.noOfPromotions = self.fp.getProperty(
                                                           'noOfPromotions', 7)
        self.noOfEachProduct = self.fp.getProperty(
                                                          'noOfEachProduct', 3)
        self.getProducts = self.fp.getProperty('getProducts', [])
        self.effectiveDateMonthsAgo = self.fp.getProperty(
                                                'effectiveDateMonthsAgo', 18)
        self.now = DateTime()
开发者ID:eea,项目名称:eea.design,代码行数:27,代码来源:frontpage.py

示例2: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     BrowserView.__init__(self, *args, **kwargs)
     tool = getToolByName(self.context, 'portal_url')
     portal = tool.getPortalObject()
     self.sm = SubscriptionManager(portal)
     obj = self.context.aq_explicit
     self.contenttype = obj.__class__.__name__
开发者ID:milieuinfo,项目名称:minaraad,代码行数:9,代码来源:subscribers.py

示例3: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
 def __init__(self, context, request):
     BrowserView.__init__(self, context, request)
     self.request.set('disable_border', 1)
     # following two only on Plone 4+
     self.request.set('disable_plone.leftcolumn', 1)
     self.request.set('disable_plone.rightcolumn', 1)
     
开发者ID:RedTurtle,项目名称:auslfe.formonline.tokenaccess,代码行数:8,代码来源:view.py

示例4: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
 def __init__(self, context, request):
     BrowserView.__init__(self, context, request)
 
     self.catalog = getToolByName(self.context, 'portal_catalog')
     self.portal_state = getMultiAdapter((context, request),
                                            name=u'plone_portal_state')
     self.navigation_root_url = self.portal_state.navigation_root_url()
开发者ID:ksuess,项目名称:Products.zhkath,代码行数:9,代码来源:views.py

示例5: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
 def __init__(self, *args, **kw):
     BrowserView.__init__(self, *args, **kw)
     tr = Transmogrifier(self.context)
     print "Iniciando importações"
     #Name "import" as registered in this packages configure.zcml
     tr("import")
     self.request.RESPONSE.redirect(self.context.absolute_url())
开发者ID:jsbueno,项目名称:quintagroup.transmogrifier,代码行数:9,代码来源:triggerviews.py

示例6: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
    def __init__(self, context, request):
        pdict = facetParameters(context, request)
        self.facet_fields = pdict['fields']
        self.facet_types = pdict['types']
        self.facet_range_gap = 7 # days

        self.friendly_type_names = \
                    component.queryUtility(
                        IVocabularyFactory, 
                        name=u'plone.app.vocabularies.ReallyUserFriendlyTypes')(self)

        standard = filter(lambda f: self.facet_types[f] == 'standard', self.facet_fields)
        ranges = filter(lambda f: self.facet_types[f] == 'range', self.facet_fields)
        self.default_query = {'facet': 'true',
                              'facet.field': standard,
                              'b_size': 10}
        if ranges:
            # TODO: need config for these values
            self.default_query.update({
                              'facet.range': ranges, 
                              'facet.range.start': 'NOW/DAY-6MONTHS',
                              'facet.range.end': 'NOW/DAY', 
                              'facet.range.gap': '+%sDAYS' % self.facet_range_gap,
                              'facet.range.other': 'all', })

        self.submenus = [dict(title=field, id=field) for field in self.facet_fields]
        self.queryparam = 'fq'
        BrowserView.__init__(self, context, request)
开发者ID:syslabcom,项目名称:slc.facetedsearch,代码行数:30,代码来源:facets.py

示例7: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
    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())
开发者ID:Conectivo,项目名称:Products.PloneSoftwareCenter,代码行数:10,代码来源:roadmap.py

示例8: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
    def __init__(self, context, request):
        BrowserView.__init__(self, context, request)

        self.catalog = getToolByName(context, 'portal_catalog')
        portal_properties = getToolByName(context, 'portal_properties')
        #gallery_properties = getattr(portal_properties,
        #                                        'gallery_properties')
        self.portal_url = getToolByName(aq_inner(context), 'portal_url')()
开发者ID:iwlearn,项目名称:iwlearn.mediagallery,代码行数:10,代码来源:gallery.py

示例9: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
 def __init__(self, context, request):
     alsoProvides(request, IDisableCSRFProtection)
     BrowserView.__init__(self, context, request)
     self.context = context
     self.request = request
     self.filepath = os.environ.get('DATA_ANALYSIS_PATH')
     self.outpath = os.environ.get('TESTRUN_RESULTS_OUTPUT_PATH')
     self.threshold = int(
         os.environ.get('DATA_ANALYSIS_AGE_THRESHOLD', 12000))
开发者ID:immunarray,项目名称:immunarray.lims,代码行数:11,代码来源:import_data_analysis.py

示例10: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
 def __init__(self, context, request):
     BrowserView.__init__(self, context, request)
     self._request_fixups()
     self.load_filter_state()
     query = self.compose_from_query_state()
     self.include_subfolders = 'include_subfolders' in request
     self.provider = FacetedListing(self.context,
         query,
         self.include_subfolders)
     self._sorted_filters = {}
开发者ID:gu-eresearch,项目名称:plone.app.folderui,代码行数:12,代码来源:listing.py

示例11: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
    def __init__(self, context, request):
        BrowserView.__init__(self, context, request)
        sp=getToolByName(context, "portal_properties").site_properties
        plone=getMultiAdapter((self.context, self.request), name="plone")

        def crop(text):
            return plone.cropText(text,
                    sp.search_results_description_length, sp.ellipsis)

        self.crop=crop
        self.normalize=getUtility(IIDNormalizer).normalize
        self.icons=plone.icons_visible()
        self.portal=getMultiAdapter((context, request),
                                    name="plone_portal_state").portal_url()+"/"
开发者ID:hexagonit,项目名称:Products.Ploneboard,代码行数:16,代码来源:search.py

示例12: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
    def __init__(self, context, request):
        BrowserView.__init__(self, context, request)
        self.mt=getToolByName(self.context, "portal_membership")
        self.tool=getToolByName(self.context, TIMETOOLNAME)

        self.period=self.request.get("period", "week")
        self.person=self.request.get("person", "all")
        self.group_by=self.request.get("group_by", "day")
        self.today=DateTime()
        start = self.request.get("start")
        if start is not None:
            start = DateTime(start)
        else:
            start = DateTime()
        (self.start, self.end)=DateToPeriod(period=self.period, date=start)
开发者ID:Blaastolen,项目名称:intranett,代码行数:17,代码来源:worklog.py

示例13: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
    def __init__(self, context, request):
        BrowserView.__init__(self, context, request)

        portal_properties = getToolByName(
            context,
            "portal_properties"
        )
        self.site_properties = portal_properties.site_properties
        plone = getMultiAdapter((self.context, self.request), name="plone")
        self.normalize = getUtility(IIDNormalizer).normalize
        self.icons = plone.icons_visible()
        portal_state = getMultiAdapter(
            (context, request),
            name="plone_portal_state"
        )
        self.portal = portal_state.portal_url() + "/"
开发者ID:RedTurtle,项目名称:Products.Ploneboard,代码行数:18,代码来源:search.py

示例14: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
 def __init__(self, context, request):
     BrowserView.__init__(self, context, request)
     self.exporter = getUtility(IBookingExporter)
     self.catalog = getToolByName(self.context, "portal_catalog")
     
     if request.form.get("export_type") == "csv":
         self.__call__ = self.exportToCsv
     elif request.form.get("export_type") == "html":
         self.values = self.getValues()
         if len(self.values) < 1:
             self.context.plone_utils.addPortalMessage(
                 _(
                     'info_no_results',
                     "There is no booking matching your criteria."
                 ),
                 "info",
             )
     else:
         self.values = None
开发者ID:patrickwestphal,项目名称:Products.PloneBooking,代码行数:21,代码来源:export.py

示例15: __init__

# 需要导入模块: from Products.Five import BrowserView [as 别名]
# 或者: from Products.Five.BrowserView import __init__ [as 别名]
    def __init__(self, context, request):
        BrowserView.__init__(self, context, request)
        self.groupid = request.get('groupid', None)

        # Some private attributes which are here for performance reasons.
        props = getToolByName(context, 'portal_properties', None)
        if props is not None:
            stp = getattr(props, 'site_properties', None)
            if stp is not None:
                self._publicGroups = stp.getProperty('allowedPublicGroups', ())

        # If no id is given, use the first one in the allowed list
        if self.groupid is None and len(self._publicGroups) > 0:
            self.groupid = self._publicGroups[0]

        self._groupinfo = {}
        self._group = None
        self._gtool = getToolByName(context, 'portal_groups', None)
        if self._gtool is not None:
            self._groupinfo = self._gtool.getGroupInfo(self.groupid) or {}
            self._group = self._gtool.getGroupById(self.groupid) or None
开发者ID:jean,项目名称:Products.PloneOrg,代码行数:23,代码来源:group.py


注:本文中的Products.Five.BrowserView.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。