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

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

Set entry's categories 

Definition at line 1969 of file COREBlog.py.

01969                                                                                 :
        """ Set entry's categories """
        import xmlrpclib
        try:
            int_id = int(postid)
            #get entry
            ent = self.getEntry(int_id)
            main_cat = None
            sub_cats = []
            for cat in categories:
                if cat.has_key('isPrimary') and cat['isPrimary']:
                    main_cat = cat['categoryId']
                else:
                    sub_cats.append(cat['categoryId'])
            cat = []
            if main_cat:
                cat = [main_cat]
            cat = cat + sub_cats
            if len(cat) == 0:
                return
            ent.set_category(cat)
            return xmlrpclib.True
        except:
            return xmlrpclib.False

    security.declareProtected(View, 'getTrackbackPings')
    def getTrackbackPings(self,postid,REQUEST=None):


Generated by  Doxygen 1.6.0   Back to index