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


Python BikaListingView.folderitems方法代码示例

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


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

示例1: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):
        mtool = getToolByName(self.context, "portal_membership")
        if mtool.checkPermission(ManageBika, self.context):
            del self.review_states[0]["transitions"]
            self.show_select_column = True
            self.review_states.append(
                {
                    "id": "active",
                    "title": _("Active"),
                    "contentFilter": {"inactive_state": "active"},
                    "transitions": [{"id": "deactivate"}],
                    "columns": ["Title", "Description"],
                }
            )
            self.review_states.append(
                {
                    "id": "inactive",
                    "title": _("Dormant"),
                    "contentFilter": {"inactive_state": "inactive"},
                    "transitions": [{"id": "activate"}],
                    "columns": ["Title", "Description"],
                }
            )

        items = BikaListingView.folderitems(self)
        for x in range(len(items)):
            if "obj" in items[x]:
                items[x]["replace"]["Title"] = "<a href='%s'>%s</a>" % (items[x]["url"], items[x]["Title"])

        return items
开发者ID:rockfruit,项目名称:OLiMS,代码行数:32,代码来源:bika_sampleconditions.py

示例2: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):
        items = BikaListingView.folderitems(self)
        for x in range(len(items)):
            if not items[x].has_key('obj'): continue
            obj = items[x]['obj']

            itype = obj.getInstrumentType()
            items[x]['Type'] = itype.Title() if itype else ''
            ibrand = obj.getManufacturer()
            items[x]['Brand'] = ibrand.Title() if ibrand else ''
            items[x]['Model'] = obj.getModel()

            data = obj.getCertificateExpireDate()
            if data == '':
                items[x]['ExpiryDate'] = "No date avaliable"
            else:
                items[x]['ExpiryDate'] = data.asdatetime().strftime(self.date_format_short)
                
            if obj.isOutOfDate():
                items[x]['WeeksToExpire'] = "Out of date"
            else:
                date = int(str(obj.getWeeksToExpire()).split(',')[0].split(' ')[0])
                weeks,days = divmod(date,7)
                items[x]['WeeksToExpire'] = str(weeks)+" weeks"+" "+str(days)+" days"
                
            if obj.getMethod():
                items[x]['Method'] = obj.getMethod().Title() 
                items[x]['replace']['Method'] = "<a href='%s'>%s</a>" % \
                    (obj.getMethod().absolute_url(), items[x]['Method'])
            else:
                items[x]['Method'] = ''
            items[x]['replace']['Title'] = "<a href='%s'>%s</a>" % \
                (items[x]['url'], items[x]['Title'])

        return items
开发者ID:nafwa03,项目名称:olims,代码行数:37,代码来源:bika_instruments.py

示例3: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):
        mtool = getToolByName(self.context, 'portal_membership')
        if mtool.checkPermission(ManageBika, self.context):
            del self.review_states[0]['transitions']
            self.show_select_column = True
            self.review_states.append(
                {'id':'active',
                 'title': _('Active'),
                 'contentFilter': {'inactive_state': 'active'},
                 'transitions': [{'id':'deactivate'}, ],
                 'columns': ['Title', 'Description']})
            self.review_states.append(
                {'id':'inactive',
                 'title': _('Dormant'),
                 'contentFilter': {'inactive_state': 'inactive'},
                 'transitions': [{'id':'activate'}, ],
                 'columns': ['Title', 'Description']})

        items = BikaListingView.folderitems(self)
        for x in range(len(items)):
            if not items[x].has_key('obj'): continue
            items[x]['replace']['Title'] = "<a href='%s'>%s</a>" % \
                 (items[x]['url'], items[x]['Title'])

        return items
开发者ID:nafwa03,项目名称:olims,代码行数:27,代码来源:bika_samplematrices.py

示例4: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):
        items = BikaListingView.folderitems(self)
        props = self.context.portal_properties.site_properties
        for x in range(len(items)):
            if 'obj' not in items[x]:
                continue
            obj = items[x]['obj']
            obj_url = obj.absolute_url()
            file = obj.getReportFile()
            icon = file.getBestIcon()

            items[x]['Client'] = ''
            client = obj.getClient()
            if client:
                items[x]['replace']['Client'] = "<a href='%s'>%s</a>" % \
                                                (client.absolute_url(),
                                                 client.Title())
            items[x]['FileSize'] = '%sKb' % (file.get_size() / 1024)
            items[x]['Created'] = self.ulocalized_time(obj.created())
            items[x]['By'] = self.user_fullname(obj.Creator())

            items[x]['replace']['Title'] = \
                "<a href='%s/at_download/ReportFile'>%s</a>" % \
                (obj_url, items[x]['Title'])
        return items
开发者ID:nafwa03,项目名称:olims,代码行数:27,代码来源:__init__.py

示例5: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
 def folderitems(self):
     items = BikaListingView.folderitems(self)
     for item in items:
         if not item.has_key('obj'): continue
         obj = item['obj']
         title_link = "<a href='%s'>%s</a>" % (item['url'], item['title'])
         item['replace']['Title'] = title_link
     return items
开发者ID:nafwa03,项目名称:olims,代码行数:10,代码来源:bika_srtemplates.py

示例6: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):
        items = BikaListingView.folderitems(self)
        for x in range(len(items)):
            if not items[x].has_key('obj'): continue
            items[x]['replace']['getFullname'] = "<a href='%s'>%s</a>" % \
                 (items[x]['url'], items[x]['obj'].getFullname())

        return items
开发者ID:nafwa03,项目名称:olims,代码行数:10,代码来源:supplier.py

示例7: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
 def folderitems(self):
     items = BikaListingView.folderitems(self)
     for x in range(len(items)):
         if not items[x].has_key('obj'): continue
         obj = items[x]['obj']
         items[x]['Description'] = obj.Description()
         items[x]['replace']['Title'] = "<a href='%s'>%s</a>" % \
              (items[x]['url'], items[x]['Title'])
     return items
开发者ID:nafwa03,项目名称:olims,代码行数:11,代码来源:bika_instrumenttypes.py

示例8: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
 def folderitems(self):
     items = BikaListingView.folderitems(self)
     for x in range(len(items)):
         if not items[x].has_key('obj'): continue
         obj = items[x]['obj']
         items[x]['Title'] = obj.Title()
         items[x]['replace']['Title'] = "<a href='%s'>%s</a>" % \
                                        (items[x]['url'], items[x]['title'])
         items[x]['ProfileKey'] = obj.getProfileKey()
     return items
开发者ID:nafwa03,项目名称:olims,代码行数:12,代码来源:bika_analysisprofiles.py

示例9: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):
        items = BikaListingView.folderitems(self)
        for x in range(len(items)):
            if 'obj' not in items[x]:
                continue

            items[x]['replace']['title'] = \
                "<a href='%s'>%s</a>" % (items[x]['url'], items[x]['title'])

        return items
开发者ID:nafwa03,项目名称:olims,代码行数:12,代码来源:bika_arpriorities.py

示例10: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):

        items = BikaListingView.folderitems(self)
        for x in range(len(items)):
            if 'obj' not in items[x]:
                continue
            items[x]['replace']['Title'] = "<a href='%s'>%s</a>" % \
                 (items[x]['url'], items[x]['Title'])
            items[x]['getEffectiveDate'] = self.ulocalized_time(items[x]['obj'].getEffectiveDate())
            items[x]['getExpirationDate'] = self.ulocalized_time(items[x]['obj'].getExpirationDate())

        return items
开发者ID:nafwa03,项目名称:olims,代码行数:14,代码来源:pricelist.py

示例11: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
 def folderitems(self):
     items = BikaListingView.folderitems(self)
     for x in range(len(items)):
         if not items[x].has_key('obj'): continue
         obj = items[x]['obj']
         items[x]['Title'] = obj.Title()
         items[x]['replace']['Title'] = "<a href='%s'>%s</a>" % \
              (items[x]['url'], items[x]['Title'])
         st = obj.getSampleType()
         items[x]['SampleType'] = obj.getSampleType().Title() \
             if obj.getSampleType() else ""
     return items
开发者ID:nafwa03,项目名称:olims,代码行数:14,代码来源:bika_analysisspecs.py

示例12: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
 def folderitems(self):
     items = BikaListingView.folderitems(self)
     items.sort(key=itemgetter('OrderDate'), reverse=True)
     for x in range(len(items)):
         if not items[x].has_key('obj'): continue
         obj = items[x]['obj']
         items[x]['OrderNumber'] = obj.getOrderNumber()
         items[x]['OrderDate'] = self.ulocalized_time(obj.getOrderDate())
         items[x]['DateDispatched'] = self.ulocalized_time(obj.getDateDispatched())
         items[x]['replace']['OrderNumber'] = "<a href='%s'>%s</a>" % \
              (items[x]['url'], items[x]['OrderNumber'])
     return items
开发者ID:nafwa03,项目名称:olims,代码行数:14,代码来源:supplyorderfolder.py

示例13: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):
        items = BikaListingView.folderitems(self)
        for x in range(len(items)):
            if not items[x].has_key('obj'): continue

            obj = items[x]['obj']
            items[x]['replace']['title'] = \
                "<a href='%s'>%s</a>" % (items[x]['url'], items[x]['title'])
            items[x]['replace']['getClientTitle'] = \
                "<a href='%s'>%s</a>" % (
                        obj.aq_parent.absolute_url(), obj.aq_parent.Title())

        return items
开发者ID:nafwa03,项目名称:olims,代码行数:15,代码来源:arimports.py

示例14: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
 def folderitems(self):
     items = BikaListingView.folderitems(self)
     for x in range(len(items)):
         if not items[x].has_key('obj'): continue
         obj = items[x]['obj']
         items[x]['replace']['Title'] = "<a href='%s'>%s</a>" % \
              (items[x]['url'], items[x]['Title'])
         items[x]['Description'] = obj.Description()
         if obj.aq_parent.portal_type == 'Client':
             items[x]['Owner'] = obj.aq_parent.Title()
         else:
             items[x]['Owner'] = self.context.bika_setup.laboratory.Title()
     return items
开发者ID:nafwa03,项目名称:olims,代码行数:15,代码来源:bika_storagelocations.py

示例15: folderitems

# 需要导入模块: from lims.browser.bika_listing import BikaListingView [as 别名]
# 或者: from lims.browser.bika_listing.BikaListingView import folderitems [as 别名]
    def folderitems(self):
        items = BikaListingView.folderitems(self)
        for x in range(len(items)):
            if not items[x].has_key('obj'): continue
            obj = items[x]['obj']
            items[x]['Name'] = obj.getName()
            items[x]['Email'] = obj.getEmailAddress()
            items[x]['Phone'] = obj.getPhone()
            items[x]['Fax'] = obj.getFax()
            items[x]['replace']['Name'] = "<a href='%s'>%s</a>" % \
                 (items[x]['url'], items[x]['Name'])

        return items
开发者ID:nafwa03,项目名称:olims,代码行数:15,代码来源:bika_suppliers.py


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