Logo Search packages:      
Sourcecode: zope-coreblog version File versions

def zope-coreblog-1.0::COREBlog::COREBlog::getPostCategories (   self,
  postid,
  username,
  password,
  REQUEST = None 
)

Return entry's categories 

Definition at line 1945 of file COREBlog.py.

01945                                                                      :
        """ Return entry's categories """
        import xmlrpclib
        int_id = int(postid)
        #get entry
        ent = self.getEntry(int_id)
        c = convert_charcode
        bc = self.get_blogclient_charcode()
        cl = ent.entry_category_list()
        rl = []
        if len(cl) > 0:
            #Add primary category
            rl = rl + [ {'categoryName':c(cl[0].name,bc,self.get_charcode()),
                         'categoryId':str(cl[0].id),
                         'isPrimary':1} ]
            #Add sub categories
            if len(cl) > 1:
                for cat in cl[1:]:
                    rl = rl + [ {'categoryName':c(cat.name,bc,self.get_charcode()),
                                 'categoryId':str(cat.id),
                                 'isPrimary':0} ]
        return rl

    security.declareProtected(ManageCOREBlog, 'setPostCategories')
    def setPostCategories(self,postid,username,password,categories,REQUEST=None):


Generated by  Doxygen 1.6.0   Back to index