Exemplo n.º 1
0
 def get_cached_newsfeeds(cls, user_id):
     queryset = Newsfeed.objects.filter(
         user_id=user_id).order_by('-created_at')
     key = USER_NEWSFEEDS_PATTERN.format(user_id=user_id)
     return RedisHelper.load_objects(key, queryset)
Exemplo n.º 2
0
 def get_cached_tweets(cls, user_id):
     queryset = Tweet.objects.filter(
         user_id=user_id).order_by('-created_at')
     key = USER_TWEETS_PATTERN.format(user_id=user_id)
     return RedisHelper.load_objects(key, queryset)