Move SubredditPopularityByLanguage to models.

This commit is contained in:
Neil Williams
2011-07-21 16:05:10 -07:00
parent f8efeb60f3
commit ddc3bafee0
2 changed files with 11 additions and 9 deletions

View File

@@ -19,18 +19,10 @@
# All portions of the code written by CondeNet are Copyright (c) 2006-2010
# CondeNet, Inc. All Rights Reserved.
################################################################################
from r2.models import Subreddit
from r2.models import Subreddit, SubredditPopularityByLanguage
from r2.lib.db.operators import desc
from r2.lib import count
from r2.lib.utils import fetch_things2, flatten
from r2.lib.db import tdb_cassandra
from r2.lib.cache import CL_ONE
class SubredditPopularityByLanguage(tdb_cassandra.View):
_use_db = True
_value_type = 'pickle'
_use_new_ring = True
_read_consistency_level = CL_ONE
# the length of the stored per-language list
limit = 1000

View File

@@ -35,6 +35,9 @@ from r2.lib.utils import timeago
from r2.lib.cache import sgm
from r2.lib.strings import strings, Score
from r2.lib.filters import _force_unicode
from r2.lib.db import tdb_cassandra
from r2.lib.cache import CL_ONE
import os.path
import random
@@ -944,3 +947,10 @@ Subreddit.__bases__ += (UserRel('moderator', SRMember),
UserRel('contributor', SRMember),
UserRel('subscriber', SRMember, disable_ids_fn = True),
UserRel('banned', SRMember))
class SubredditPopularityByLanguage(tdb_cassandra.View):
_use_db = True
_value_type = 'pickle'
_use_new_ring = True
_read_consistency_level = CL_ONE