]> git.openstreetmap.org Git - osqa.git/commitdiff
information about questions, answers and comments count
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 20 Jul 2011 12:43:08 +0000 (12:43 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 20 Jul 2011 12:43:08 +0000 (12:43 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1126 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/updates/base.py
forum_modules/updates/views.py

index 51fcdbe8a23ba18c74f468d25d639d7bf808bfb3..2303152fc38c29f47aea73f5d9e06d08177aab83 100644 (file)
@@ -15,7 +15,7 @@ import logging
 
 from xml.dom.minidom import parse, parseString
 from forum.base import get_database_engine
-from forum.models import Question, User
+from forum.models import Question, Answer, Comment, User
 from forum.settings import APP_URL, SVN_REVISION, APP_TITLE, APP_DESCRIPTION
 from django import VERSION as DJANGO_VERSION
 from django.utils import simplejson
@@ -99,6 +99,9 @@ def check_for_updates():
     <app_description value="%(app_description)s" />
     <svn_revision value="%(svn_revision)d" />
     <views value="%(site_views)d" />
+    <questions_count value="%(questions_count)d" />
+    <answers_count value="%(answers_count)d" />
+    <comments_count value="%(comments_count)d" />
     <active_users value="%(active_users)d" />
     <server value="%(server_name)s" />
     <python_version value="%(python_version)s" />
@@ -114,6 +117,9 @@ def check_for_updates():
         'svn_revision' : svn_revision,
         'site_views' : get_site_views(),
         'server_name' : get_server_name(),
+        'questions_count' : Question.objects.filter_state(deleted=False).count(),
+        'answers_count' : Answer.objects.filter_state(deleted=False).count(),
+        'comments_count' : Comment.objects.filter_state(deleted=False).count(),
         'active_users' : get_active_users(),
         'python_version' : ''.join(sys.version.splitlines()),
         'django_version' : str(DJANGO_VERSION),
index c811364fce83e0467f26ab5140f3e9da1597d663..27008f250497f54610801ada1274f3fddf386bd7 100644 (file)
@@ -8,7 +8,7 @@ from forum.views.admin import admin_tools_page, admin_page
 @admin_tools_page(_('updater'), _('Update Checker'))
 def updater_index(request):
     return (
-        'modules/updater/index.html',
+        'modules/updates/index.html',
         {
 
         },