def _data(self):        
     limit = self.data.count
     
     from statistics import getMostUsedTags
     strpath = "/".join(self.context.getPhysicalPath())
     try:
         from ubify.policy.config import contentroot_details
         rootid = contentroot_details['id']                
         objRoot = getattr(self.portal,rootid)
         if self.context == objRoot:
             strpath = "/".join(self.portal.getPhysicalPath())
             self.is_site_home = True
         else:
             strpath = "/".join(self.context.getPhysicalPath())
             self.is_site_home = False
     except AttributeError:
         strpath = "/".join(self.context.getPhysicalPath())
     
     try:
         results = getMostUsedTags(self.context,strpath)
     except AttributeError:
         results = []
     
     results = [k for k in results if k['count'] > 0]
     return results[:limit]
 def _data(self):
     #print "Calculating tags... %s" % time()
     strpath = "/".join(self.context.getPhysicalPath())
     results = getMostUsedTags(self.context, strpath, self.data.count)
     results.sort(
         lambda x, y: cmp(x['tagname'].lower(), y['tagname'].lower()),
         reverse=False)
     return results
 def _data(self):
     #print "Calculating tags... %s" % time()
     strpath = "/".join(self.context.getPhysicalPath())
     results = getMostUsedTags(self.context,strpath,self.data.count)
     results.sort(lambda x,y: cmp(x['tagname'].lower(),y['tagname'].lower()),reverse=False)
     return results