Пример #1
0
 def record_stats(self, stats):
     toolbar = SocialToolbarMiddleware.get_current()
     panel_stats = toolbar.stats.get(self.slug)
     if panel_stats:
         panel_stats.update(stats)
     else:
         toolbar.stats[self.slug] = stats
Пример #2
0
 def get_stats(self):
     toolbar = SocialToolbarMiddleware.get_current()
     return toolbar.stats.get(self.slug, {})