diff options
author | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2012-06-18 15:37:46 -0600 |
---|---|---|
committer | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2012-06-18 17:17:31 -0600 |
commit | e99720f1f6699ed3fc6afe52e93b2d9f9b33fd5c (patch) | |
tree | be05a60a62847473991eede161e971e6066ea575 /askbot/views/users.py | |
parent | c33fb405eae93e66578fe2ae2b5423474dee0af1 (diff) | |
download | askbot-e99720f1f6699ed3fc6afe52e93b2d9f9b33fd5c.tar.gz askbot-e99720f1f6699ed3fc6afe52e93b2d9f9b33fd5c.tar.bz2 askbot-e99720f1f6699ed3fc6afe52e93b2d9f9b33fd5c.zip |
started migrating the score field to points, models, views and test
migrated.
Added search indexes.
Diffstat (limited to 'askbot/views/users.py')
-rw-r--r-- | askbot/views/users.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/askbot/views/users.py b/askbot/views/users.py index 8bc2909d..8588f132 100644 --- a/askbot/views/users.py +++ b/askbot/views/users.py @@ -99,7 +99,7 @@ def users(request, by_group = False, group_id = None, group_slug = None): } ) return HttpResponseRedirect(group_page_url) - + is_paginated = True @@ -331,7 +331,7 @@ def user_stats(request, user, context): # Questions # questions = user.posts.get_questions().filter(**question_filter).\ - order_by('-score', '-thread__last_activity_at').\ + order_by('-points', '-thread__last_activity_at').\ select_related('thread', 'thread__last_activity_by')[:100] #added this if to avoid another query if questions is less than 100 @@ -347,7 +347,7 @@ def user_stats(request, user, context): deleted=False, thread__posts__deleted=False, thread__posts__post_type='question', - ).select_related('thread').order_by('-score', '-added_at')[:100] + ).select_related('thread').order_by('-points', '-added_at')[:100] top_answer_count = len(top_answers) @@ -381,7 +381,7 @@ def user_stats(request, user, context): interesting_tag_names = None ignored_tag_names = None subscribed_tag_names = None - + # tags = models.Post.objects.filter(author=user).values('id', 'thread', 'thread__tags') # post_ids = set() # thread_ids = set() @@ -800,7 +800,7 @@ def user_favorites(request, user, context): favorite_threads = user.user_favorite_questions.values_list('thread', flat=True) questions = models.Post.objects.filter(post_type='question', thread__in=favorite_threads)\ .select_related('thread', 'thread__last_activity_by')\ - .order_by('-score', '-thread__last_activity_at')[:const.USER_VIEW_DATA_SIZE] + .order_by('-points', '-thread__last_activity_at')[:const.USER_VIEW_DATA_SIZE] data = { 'active_tab':'users', |