Example #1
0
 def to_cache(self):
     mapping = {
         'slug': self.slug,
         'user_list': [],
         'channels': [],
     }
     cache.hmset(self.cache_key, mapping)
Example #2
0
 def to_info(self):
     mapping = {
         'slug': self.slug,
         'name_en': self.name_en,
         'name_zh': self.name_zh,
         'author_slug': self.author_slug,
         'description': self.description
     }
     cache.hmset(self.cache_key, mapping)