Logo Search packages:      
Sourcecode: zope-cmfbibliographyat version File versions  Download package

def CMFBibliographyAT::content::base::BaseEntry::getSiteMembers (   self,
  args,
  kw 
)

For use when members are authors, return a DisplayList of members
Alternative to 'getMembers' if 'no reference' must not be empty
(to work around a bug in the 'Records' packager)

Definition at line 366 of file base.py.

00366                                          :
        """
        For use when members are authors, return a DisplayList of members
        Alternative to 'getMembers' if 'no reference' must not be empty
        (to work around a bug in the 'Records' packager)
        """
        value = DisplayList()
        value.add('None', 'Select or specify')
        if self.showMemberAuthors():
            bib_tool = getToolByName(self, 'portal_bibliography')
            membertypes = bib_tool.getProperty('member_types')
            sort_on = bib_tool.getProperty('sort_members_on', 'getId')
            catalog = getToolByName(self, 'portal_catalog')
            results = catalog(portal_type=membertypes,
                              sort_on=sort_on)
            for r in results:
                uid = getattr(aq_base(r), 'UID', r.getObject().UID())
                title = r.Title or r.id
                value.add(uid, title)
        elif self.usesCMFMember():   # BBB
            md = getToolByName(self, 'portal_memberdata')
            membertypes = md.getAllowedMemberTypes()
            catalog = getToolByName(self, 'portal_catalog')
            results = catalog(portal_type=membertypes,
                              sort_on='getId')
            for r in results:
                uid = getattr(aq_base(r), 'UID', r.getObject().UID())
                title = r.Title or r.id
                value.add(uid, title)
        return value

    security.declareProtected(View, 'showMemberAuthors')
    def showMemberAuthors(self):


Generated by  Doxygen 1.6.0   Back to index