summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhrcerqueira <hrcerqueira@gmail.com>2010-03-04 12:37:15 +0000
committerhrcerqueira <hrcerqueira@gmail.com>2010-03-04 12:37:15 +0000
commit9a6943eed25b937cbb90d0e35f65e375e404d589 (patch)
tree640fbaee9437c9cc2850f3bff28fa2afd781f0ab
parentc05e229c817647799a991028bee6cb727301b0a6 (diff)
downloadaskbot-9a6943eed25b937cbb90d0e35f65e375e404d589.tar.gz
askbot-9a6943eed25b937cbb90d0e35f65e375e404d589.tar.bz2
askbot-9a6943eed25b937cbb90d0e35f65e375e404d589.zip
added postgres specific management commands for the badges cron jobs.
some extra small fixes
-rwxr-xr-x.idea/workspace.xml243
-rwxr-xr-xforum/management/commands/pg_base_command.py35
-rwxr-xr-xforum/management/commands/pg_clean_award_badges.py59
-rwxr-xr-xforum/management/commands/pg_multi_award_badges.py348
-rwxr-xr-xforum/management/commands/pg_once_award_badges.py350
-rwxr-xr-xforum/models/__init__.py2
6 files changed, 926 insertions, 111 deletions
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 44b0b2f7..878a69f9 100755
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -22,21 +22,21 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/close.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/close.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/facebook.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/facebook.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/openid-inputicon.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/openid-inputicon.gif" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/facebookauth/templates/xd_receiver.html" afterPath="$PROJECT_DIR$/forum_modules/facebookauth/templates/xd_receiver.html" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/vote-favorite-on.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/vote-favorite-on.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/technorati.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/technorati.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.flot.pack.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.flot.pack.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/email_base.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/email_base.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/feedback_email.txt" afterPath="$PROJECT_DIR$/forum/skins/default/templates/feedback_email.txt" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/books/views.py" afterPath="$PROJECT_DIR$/forum_modules/books/views.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/osqa.iml" afterPath="$PROJECT_DIR$/osqa.iml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/books/views.py" afterPath="$PROJECT_DIR$/forum_modules/books/views.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/tags.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/tags.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/models/tag.py" afterPath="$PROJECT_DIR$/forum/models/tag.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/pgfulltext/__init__.py" afterPath="$PROJECT_DIR$/forum_modules/pgfulltext/__init__.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/utils/email.py" afterPath="$PROJECT_DIR$/forum/utils/email.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/compress.bat" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/compress.bat" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/sphinxfulltext/dependencies.py" afterPath="$PROJECT_DIR$/forum_modules/sphinxfulltext/dependencies.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/compress.bat" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/compress.bat" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/utils/email.py" afterPath="$PROJECT_DIR$/forum/utils/email.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/ask.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/ask.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/users_questions.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/users_questions.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/vote-favorite-off.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/vote-favorite-off.png" />
@@ -45,12 +45,12 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/medala.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/medala.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/question_edit.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/question_edit.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.tag_selector.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.tag_selector.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.i18n.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.i18n.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/claimid.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/claimid.ico" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.i18n.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.i18n.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/utils/decorators.py" afterPath="$PROJECT_DIR$/forum/utils/decorators.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/logo.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/logo.gif" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/cc-88x31.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/cc-88x31.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/pgfulltext/handlers.py" afterPath="$PROJECT_DIR$/forum_modules/pgfulltext/handlers.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/cc-88x31.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/cc-88x31.png" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/logo.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/logo.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/openidauth/consumer.py" afterPath="$PROJECT_DIR$/forum_modules/openidauth/consumer.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user_edit.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user_edit.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
@@ -72,48 +72,48 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/livejournal.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/livejournal.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/views/commands.py" afterPath="$PROJECT_DIR$/forum/views/commands.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.utils.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.utils.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd-min.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd-min.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/wordpress.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/wordpress.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/sitemap.py" afterPath="$PROJECT_DIR$/forum/sitemap.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/wordpress.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/wordpress.ico" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd-min.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd-min.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/question_summary_list_roll.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/question_summary_list_roll.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/blogger-1.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/blogger-1.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/sphinxfulltext/__init__.py" afterPath="$PROJECT_DIR$/forum_modules/sphinxfulltext/__init__.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/blogger-1.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/blogger-1.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/privacy.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/privacy.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/reopen.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/reopen.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/commands/send_email_alerts.py" afterPath="$PROJECT_DIR$/forum/management/commands/send_email_alerts.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/livejournal.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/livejournal.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/fbconnect/xd_receiver.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/fbconnect/xd_receiver.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/edit.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/edit.png" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/user_messages/context_processors.py" afterPath="$PROJECT_DIR$/forum/user_messages/context_processors.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/blue-up-arrow-h18px.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/blue-up-arrow-h18px.png" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/user_messages/context_processors.py" afterPath="$PROJECT_DIR$/forum/user_messages/context_processors.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/wmd.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/utils/time.py" afterPath="$PROJECT_DIR$/forum/utils/time.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/auth.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/auth.css" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/user_messages/__init__.py" afterPath="$PROJECT_DIR$/forum/user_messages/__init__.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/utils/time.py" afterPath="$PROJECT_DIR$/forum/utils/time.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/__init__.py" afterPath="$PROJECT_DIR$/forum/management/__init__.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/user_messages/__init__.py" afterPath="$PROJECT_DIR$/forum/user_messages/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/se_hilite.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/se_hilite.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/bullet_green.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/bullet_green.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/middleware/__init__.py" afterPath="$PROJECT_DIR$/forum/middleware/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/yahoo.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/yahoo.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/utils/forms.py" afterPath="$PROJECT_DIR$/forum/utils/forms.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/commands/sample_command.py" afterPath="$PROJECT_DIR$/forum/management/commands/sample_command.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/models/answer.py" afterPath="$PROJECT_DIR$/forum/models/answer.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/commands/sample_command.py" afterPath="$PROJECT_DIR$/forum/management/commands/sample_command.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/middleware/anon_user.py" afterPath="$PROJECT_DIR$/forum/middleware/anon_user.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/openid.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/openid.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/logo.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/logo.png" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/openid.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/openid.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/showdown.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/showdown.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/localauth/views.py" afterPath="$PROJECT_DIR$/forum_modules/localauth/views.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/auth/signup.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/auth/signup.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.validate.pack.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.validate.pack.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/views/users.py" afterPath="$PROJECT_DIR$/forum/views/users.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/localauth/urls.py" afterPath="$PROJECT_DIR$/forum_modules/localauth/urls.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/prettify.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/prettify.css" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/views/users.py" afterPath="$PROJECT_DIR$/forum/views/users.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/grippie.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/grippie.png" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/prettify.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/prettify.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/faq.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/faq.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/tag_selector.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/tag_selector.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/aol.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/aol.gif" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/openid.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/openid.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/flickr.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/flickr.png" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/openid.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/openid.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/images/wmd-buttons.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/wmd/images/wmd-buttons.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user_footer.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user_footer.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/vote-accepted-on.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/vote-accepted-on.png" />
@@ -135,35 +135,35 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/vidoop.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/vidoop.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/openid-inputicon.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/openid-inputicon.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/commands/clean_award_badges.py" afterPath="$PROJECT_DIR$/forum/management/commands/clean_award_badges.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/vidoop.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/vidoop.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/facebookauth/views.py" afterPath="$PROJECT_DIR$/forum_modules/facebookauth/views.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/twitter.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/twitter.png" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/djangomade124x25_grey.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/djangomade124x25_grey.gif" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/vidoop.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/vidoop.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/djangomade124x25_grey.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/djangomade124x25_grey.gif" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/twitter.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/twitter.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/google.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/google.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/authentication/__init__.py" afterPath="$PROJECT_DIR$/forum/authentication/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/oauthauth/lib/__init__.py" afterPath="$PROJECT_DIR$/forum_modules/oauthauth/lib/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/models/base.py" afterPath="$PROJECT_DIR$/forum/models/base.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/templatetags/extra_tags.py" afterPath="$PROJECT_DIR$/forum/templatetags/extra_tags.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/openidauth/models.py" afterPath="$PROJECT_DIR$/forum_modules/openidauth/models.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/style.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/style.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/feed-icon-small.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/feed-icon-small.png" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/style.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/style.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/close-small.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/close-small.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/modules.xml" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/authentication/base.py" afterPath="$PROJECT_DIR$/forum/authentication/base.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/index.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/index.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/quest-bg.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/quest-bg.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/facebookauth/__init__.py" afterPath="$PROJECT_DIR$/forum_modules/facebookauth/__init__.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/commands/message_to_everyone.py" afterPath="$PROJECT_DIR$/forum/management/commands/message_to_everyone.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/quest-bg.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/quest-bg.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/base.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/base.html" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/commands/message_to_everyone.py" afterPath="$PROJECT_DIR$/forum/management/commands/message_to_everyone.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/question_edit_tips.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/question_edit_tips.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/const.py" afterPath="$PROJECT_DIR$/forum/const.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cron/once_award_badges_virtualenv" afterPath="$PROJECT_DIR$/cron/once_award_badges_virtualenv" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/models/question.py" afterPath="$PROJECT_DIR$/forum/models/question.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/logo1.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/logo1.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/livejournal-1.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/livejournal-1.png" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery-1.2.6.min.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery-1.2.6.min.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/books/urls.py" afterPath="$PROJECT_DIR$/forum_modules/books/urls.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery-1.2.6.min.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery-1.2.6.min.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/auth/email_validation.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/auth/email_validation.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user_favorites.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user_favorites.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/__init__.py" afterPath="$PROJECT_DIR$/forum/__init__.py" />
@@ -178,10 +178,10 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/auth/temp_login_request.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/auth/temp_login_request.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/modules.py" afterPath="$PROJECT_DIR$/forum/modules.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/common/media/README" afterPath="$PROJECT_DIR$/forum/skins/common/media/README" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/dash.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/dash.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/openidauth/authentication.py" afterPath="$PROJECT_DIR$/forum_modules/openidauth/authentication.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/close-small-hover.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/close-small-hover.png" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/dash.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/dash.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/authentication/forms.py" afterPath="$PROJECT_DIR$/forum/authentication/forms.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/close-small-hover.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/close-small-hover.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/views/writers.py" afterPath="$PROJECT_DIR$/forum/views/writers.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/books/__init__.py" afterPath="$PROJECT_DIR$/forum_modules/books/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/verisign.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/verisign.ico" />
@@ -189,11 +189,11 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/myopenid.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/myopenid.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/openidico16.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/openidico16.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/badges.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/badges.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/views/__init__.py" afterPath="$PROJECT_DIR$/forum/views/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/verisign.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/verisign.ico" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/views/__init__.py" afterPath="$PROJECT_DIR$/forum/views/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/se_hilite_src.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/se_hilite_src.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/jquery.autocomplete.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/jquery.autocomplete.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/expander-arrow-show.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/expander-arrow-show.gif" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/style/jquery.autocomplete.css" afterPath="$PROJECT_DIR$/forum/skins/default/media/style/jquery.autocomplete.css" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/answer_edit_tips.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/answer_edit_tips.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/verisign-2.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/verisign-2.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/utils/odict.py" afterPath="$PROJECT_DIR$/forum/utils/odict.py" />
@@ -205,8 +205,8 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/openidauth/store.py" afterPath="$PROJECT_DIR$/forum_modules/openidauth/store.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/favicon.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/favicon.gif" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/nophoto.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/nophoto.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/pgfulltext/management.py" afterPath="$PROJECT_DIR$/forum_modules/pgfulltext/management.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/nophoto.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/nophoto.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/views/README" afterPath="$PROJECT_DIR$/forum/views/README" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/oauthauth/authentication.py" afterPath="$PROJECT_DIR$/forum_modules/oauthauth/authentication.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/question.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/question.html" />
@@ -219,10 +219,10 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/question_retag.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/question_retag.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user_votes.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user_votes.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/yuicompressor-2.4.2.jar" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/yuicompressor-2.4.2.jar" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.i18n.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.i18n.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/blogger.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/blogger.ico" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/sphinxfulltext/handlers.py" afterPath="$PROJECT_DIR$/forum_modules/sphinxfulltext/handlers.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.i18n.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.i18n.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/sql_scripts/update_2010_01_23.sql" afterPath="$PROJECT_DIR$/sql_scripts/update_2010_01_23.sql" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/sphinxfulltext/handlers.py" afterPath="$PROJECT_DIR$/forum_modules/sphinxfulltext/handlers.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/settings.py" afterPath="$PROJECT_DIR$/forum/settings.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/models/meta.py" afterPath="$PROJECT_DIR$/forum/models/meta.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/authopenid/signin.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/authopenid/signin.html" />
@@ -230,8 +230,8 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/utils/diff.py" afterPath="$PROJECT_DIR$/forum/utils/diff.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/sphinxfulltext/DISABLED" afterPath="$PROJECT_DIR$/forum_modules/sphinxfulltext/DISABLED" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/expander-arrow-hide.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/expander-arrow-hide.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/facebookauth/templates/button.html" afterPath="$PROJECT_DIR$/forum_modules/facebookauth/templates/button.html" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/expander-arrow-hide.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/expander-arrow-hide.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/feeds/rss_description.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/feeds/rss_description.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/wordpress.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/wordpress.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/oauthauth/consumer.py" afterPath="$PROJECT_DIR$/forum_modules/oauthauth/consumer.py" />
@@ -247,11 +247,11 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user_tabs.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user_tabs.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/dot-list.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/dot-list.gif" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/oauthauth/__init__.py" afterPath="$PROJECT_DIR$/forum_modules/oauthauth/__init__.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/blogger.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/blogger.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/openid/facebook.gif" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/openid/facebook.gif" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/blogger.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/blogger.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/answer_edit.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/answer_edit.html" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.post.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.post.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/oauthauth/lib/oauth.py" afterPath="$PROJECT_DIR$/forum_modules/oauthauth/lib/oauth.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.post.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/com.cnprog.post.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user_responses.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user_responses.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/jquery.openid.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/jquery.openid.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/__init__.py" afterPath="$PROJECT_DIR$/forum_modules/__init__.py" />
@@ -268,8 +268,8 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/openidauth/settings.py" afterPath="$PROJECT_DIR$/forum_modules/openidauth/settings.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/about.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/about.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cron/once_award_badges" afterPath="$PROJECT_DIR$/cron/once_award_badges" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/commands/__init__.py" afterPath="$PROJECT_DIR$/forum/management/commands/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/sphinxfulltext/settings.py" afterPath="$PROJECT_DIR$/forum_modules/sphinxfulltext/settings.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/management/commands/__init__.py" afterPath="$PROJECT_DIR$/forum/management/commands/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/README" afterPath="$PROJECT_DIR$/forum/skins/README" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/templatetags/__init__.py" afterPath="$PROJECT_DIR$/forum/templatetags/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user_email_subscriptions.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user_email_subscriptions.html" />
@@ -278,8 +278,8 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/middleware/cancel.py" afterPath="$PROJECT_DIR$/forum/middleware/cancel.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/books/models.py" afterPath="$PROJECT_DIR$/forum_modules/books/models.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/cron/multi_award_badges" afterPath="$PROJECT_DIR$/cron/multi_award_badges" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery-1.2.6.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery-1.2.6.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/oauthauth/settings.py" afterPath="$PROJECT_DIR$/forum_modules/oauthauth/settings.py" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery-1.2.6.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery-1.2.6.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/rmpyc" afterPath="$PROJECT_DIR$/rmpyc" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/user_reputation.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/user_reputation.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/admin.py" afterPath="$PROJECT_DIR$/forum/admin.py" />
@@ -293,14 +293,14 @@
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/feeds/rss_title.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/feeds/rss_title.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/header.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/header.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/pgfulltext/DISABLED" afterPath="$PROJECT_DIR$/forum_modules/pgfulltext/DISABLED" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/wordpress.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/wordpress.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/images/gray-up-arrow-h18px.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/images/gray-up-arrow-h18px.png" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/wordpress.png" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/wordpress.png" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum_modules/openidauth/__init__.py" afterPath="$PROJECT_DIR$/forum_modules/openidauth/__init__.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.openid.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.openid.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/templatetags/extra_filters.py" afterPath="$PROJECT_DIR$/forum/templatetags/extra_filters.py" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.flot.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.flot.js" />
- <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/myopenid.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/myopenid.ico" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/WISH_LIST" afterPath="$PROJECT_DIR$/WISH_LIST" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/myopenid.ico" afterPath="$PROJECT_DIR$/forum/skins/default/media/jquery-openid/images/myopenid.ico" />
+ <change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.flot.js" afterPath="$PROJECT_DIR$/forum/skins/default/media/js/jquery.flot.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/base_content.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/base_content.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/skins/default/templates/auth/signin.html" afterPath="$PROJECT_DIR$/forum/skins/default/templates/auth/signin.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/forum/feed.py" afterPath="$PROJECT_DIR$/forum/feed.py" />
@@ -385,73 +385,82 @@
</provider>
</entry>
</file>
- <file leaf-file-name="index.html" pinned="false" current="true" current-in-tab="true">
- <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/index.html">
+ <file leaf-file-name="user_stats.html" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/user_stats.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="113" column="38" selection-start="4999" selection-end="4999" vertical-scroll-proportion="0.5612903">
+ <state line="123" column="10" selection-start="5400" selection-end="5400" vertical-scroll-proportion="-18.041666">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="style.css" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/forum/skins/default/media/style/style.css">
+ <file leaf-file-name="pg_multi_award_badges.py" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/pg_multi_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="1013" column="1" selection-start="17211" selection-end="17218" vertical-scroll-proportion="-21.36">
+ <state line="22" column="20" selection-start="810" selection-end="810" vertical-scroll-proportion="-14.96">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="urls.py" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/forum/urls.py">
+ <file leaf-file-name="pg_once_award_badges.py" pinned="false" current="true" current-in-tab="true">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/pg_once_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="109" column="77" selection-start="7604" selection-end="7625" vertical-scroll-proportion="-17.2">
+ <state line="322" column="53" selection-start="13019" selection-end="13019" vertical-scroll-proportion="0.10631229">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="feed.py" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/forum/feed.py">
+ <file leaf-file-name="base_command.py" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/base_command.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="1176" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="__init__.py" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/forum/models/__init__.py">
+ <file leaf-file-name="pg_base_command.py" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/pg_base_command.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="95" column="61" selection-start="4124" selection-end="4124" vertical-scroll-proportion="-20.68">
+ <state line="27" column="59" selection-start="1022" selection-end="1022" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="base.py" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/forum/models/base.py">
+ <file leaf-file-name="once_award_badges.py" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/once_award_badges.py">
+ <provider selected="true" editor-type-id="text-editor">
+ <state line="0" column="0" selection-start="0" selection-end="13851" vertical-scroll-proportion="0.0">
+ <folding />
+ </state>
+ </provider>
+ </entry>
+ </file>
+ <file leaf-file-name="__init__.py" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/forum/models/__init__.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="207" column="43" selection-start="8815" selection-end="8815" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="settings.py" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/settings.py">
+ <file leaf-file-name="multi_award_badges.py" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/multi_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="26" column="5" selection-start="985" selection-end="985" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="14385" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
</file>
- <file leaf-file-name="settings.py" pinned="false" current="false" current-in-tab="false">
- <entry file="file://$PROJECT_DIR$/forum/settings.py">
+ <file leaf-file-name="pg_clean_award_badges.py" pinned="false" current="false" current-in-tab="false">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/pg_clean_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="38" column="49" selection-start="1218" selection-end="1233" vertical-scroll-proportion="0.0">
+ <state line="58" column="10" selection-start="1683" selection-end="1683" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
@@ -467,22 +476,22 @@
<component name="IdeDocumentHistory">
<option name="changedFiles">
<list>
- <option value="$PROJECT_DIR$/forum/views/auth.py" />
- <option value="$PROJECT_DIR$/forum_modules/localauth/views.py" />
- <option value="$PROJECT_DIR$/forum/templatetags/extra_tags.py" />
- <option value="$PROJECT_DIR$/forum/settings_builder.py" />
- <option value="$PROJECT_DIR$/INSTALL" />
<option value="$PROJECT_DIR$/forum/settings.py" />
<option value="$PROJECT_DIR$/forum/skins/default/templates/header.html" />
<option value="$PROJECT_DIR$/forum/skins/default/templates/users.html" />
<option value="$PROJECT_DIR$/forum/skins/default/templates/questions.html" />
- <option value="$PROJECT_DIR$/forum/skins/default/templates/user_stats.html" />
<option value="$PROJECT_DIR$/forum/skins/default/templates/user_tabs.html" />
<option value="$PROJECT_DIR$/settings.py" />
<option value="$PROJECT_DIR$/forum/models/repute.py" />
<option value="$PROJECT_DIR$/forum/urls.py" />
- <option value="$PROJECT_DIR$/forum/models/__init__.py" />
<option value="$PROJECT_DIR$/forum/skins/default/templates/index.html" />
+ <option value="$PROJECT_DIR$/forum/skins/default/templates/user_stats.html" />
+ <option value="$PROJECT_DIR$/forum/management/commands/pg_clean_award_badges.py" />
+ <option value="$PROJECT_DIR$/forum/management/commands/clean_award_badges.py" />
+ <option value="$PROJECT_DIR$/forum/models/__init__.py" />
+ <option value="$PROJECT_DIR$/forum/management/commands/pg_base_command.py" />
+ <option value="$PROJECT_DIR$/forum/management/commands/pg_multi_award_badges.py" />
+ <option value="$PROJECT_DIR$/forum/management/commands/pg_once_award_badges.py" />
</list>
</option>
</component>
@@ -612,6 +621,10 @@
<option name="myItemId" value="default" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="templates" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -638,10 +651,6 @@
<option name="myItemId" value="media" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
- <PATH_ELEMENT>
- <option name="myItemId" value="style" />
- <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
- </PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
@@ -657,15 +666,25 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="skins" />
+ <option name="myItemId" value="models" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
+ </PATH>
+ <PATH>
<PATH_ELEMENT>
- <option name="myItemId" value="default" />
+ <option name="myItemId" value="osqa" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="osqa" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="media" />
+ <option name="myItemId" value="forum" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="management" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -683,7 +702,11 @@
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
- <option name="myItemId" value="models" />
+ <option name="myItemId" value="management" />
+ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+ </PATH_ELEMENT>
+ <PATH_ELEMENT>
+ <option name="myItemId" value="commands" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
</PATH_ELEMENT>
</PATH>
@@ -995,114 +1018,114 @@
<breakpoint-manager />
</component>
<component name="editorHistoryManager">
- <entry file="file://$PROJECT_DIR$/forum/views/writers.py">
+ <entry file="file://$PROJECT_DIR$/forum/feed.py">
<provider selected="true" editor-type-id="text-editor">
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/views/commands.py">
+ <entry file="file://$PROJECT_DIR$/forum/skins/default/media/style/style.css">
<provider selected="true" editor-type-id="text-editor">
- <state line="65" column="38" selection-start="2466" selection-end="2468" vertical-scroll-proportion="-3.96">
+ <state line="1013" column="1" selection-start="17211" selection-end="17218" vertical-scroll-proportion="-21.36">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/about.html">
+ <entry file="file://$PROJECT_DIR$/forum/urls.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="-0.056384742">
+ <state line="109" column="77" selection-start="7604" selection-end="7625" vertical-scroll-proportion="-17.2">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/header.html">
+ <entry file="file://$PROJECT_DIR$/osqa.wsgi.dist">
<provider selected="true" editor-type-id="text-editor">
- <state line="20" column="87" selection-start="912" selection-end="912" vertical-scroll-proportion="-7.7916665">
+ <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/user.html">
+ <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/index.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="-0.0">
+ <state line="113" column="38" selection-start="4999" selection-end="4999" vertical-scroll-proportion="-14.5">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/user_stats.html">
+ <entry file="file://$PROJECT_DIR$/forum/models/repute.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="111" column="113" selection-start="5031" selection-end="5031" vertical-scroll-proportion="-4.0416665">
+ <state line="97" column="16" selection-start="3777" selection-end="3777" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/user_tabs.html">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/clean_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="27" column="76" selection-start="2050" selection-end="2050" vertical-scroll-proportion="-19.125">
+ <state line="46" column="52" selection-start="1470" selection-end="1470" vertical-scroll-proportion="0.629742">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/settings.py">
+ <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/user_stats.html">
<provider selected="true" editor-type-id="text-editor">
- <state line="38" column="49" selection-start="1218" selection-end="1233" vertical-scroll-proportion="0.0">
+ <state line="123" column="10" selection-start="5400" selection-end="5400" vertical-scroll-proportion="-18.041666">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/settings.py">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/multi_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="26" column="5" selection-start="985" selection-end="985" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="14385" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/models/base.py">
+ <entry file="file://$PROJECT_DIR$/forum/models/__init__.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="207" column="43" selection-start="8815" selection-end="8815" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/models/repute.py">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/once_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="97" column="16" selection-start="3777" selection-end="3777" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="13851" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/feed.py">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/base_command.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
+ <state line="0" column="0" selection-start="0" selection-end="1176" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/models/__init__.py">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/pg_base_command.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="95" column="61" selection-start="4124" selection-end="4124" vertical-scroll-proportion="-20.68">
+ <state line="27" column="59" selection-start="1022" selection-end="1022" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/skins/default/media/style/style.css">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/pg_multi_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="1013" column="1" selection-start="17211" selection-end="17218" vertical-scroll-proportion="-21.36">
+ <state line="22" column="20" selection-start="810" selection-end="810" vertical-scroll-proportion="-14.96">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/urls.py">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/pg_clean_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="109" column="77" selection-start="7604" selection-end="7625" vertical-scroll-proportion="-17.2">
+ <state line="58" column="10" selection-start="1683" selection-end="1683" vertical-scroll-proportion="0.0">
<folding />
</state>
</provider>
</entry>
- <entry file="file://$PROJECT_DIR$/forum/skins/default/templates/index.html">
+ <entry file="file://$PROJECT_DIR$/forum/management/commands/pg_once_award_badges.py">
<provider selected="true" editor-type-id="text-editor">
- <state line="113" column="38" selection-start="4999" selection-end="4999" vertical-scroll-proportion="0.5612903">
+ <state line="322" column="53" selection-start="13019" selection-end="13019" vertical-scroll-proportion="0.10631229">
<folding />
</state>
</provider>
diff --git a/forum/management/commands/pg_base_command.py b/forum/management/commands/pg_base_command.py
new file mode 100755
index 00000000..a314c9eb
--- /dev/null
+++ b/forum/management/commands/pg_base_command.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+#encoding:utf-8
+#-------------------------------------------------------------------------------
+# Name: Award badges command
+# Purpose: This is a command file croning in background process regularly to
+# query database and award badges for user's special acitivities.
+#
+# Author: Mike, Sailing
+#
+# Created: 22/01/2009
+# Copyright: (c) Mike 2009
+# Licence: GPL V2
+#-------------------------------------------------------------------------------
+
+from datetime import datetime, date
+from django.core.management.base import NoArgsCommand
+from django.db import connection
+from django.shortcuts import get_object_or_404
+from django.contrib.contenttypes.models import ContentType
+
+from forum.models import *
+from forum.const import *
+
+class BaseCommand(NoArgsCommand):
+ def update_activities_auditted(self, cursor, activity_ids):
+ # update processed rows to auditted
+ if len(activity_ids):
+ query = "UPDATE activity SET is_auditted = TRUE WHERE id in (%s)"\
+ % ','.join('%s' % item for item in activity_ids)
+ cursor.execute(query)
+
+
+
+
+
diff --git a/forum/management/commands/pg_clean_award_badges.py b/forum/management/commands/pg_clean_award_badges.py
new file mode 100755
index 00000000..aa93e76b
--- /dev/null
+++ b/forum/management/commands/pg_clean_award_badges.py
@@ -0,0 +1,59 @@
+#-------------------------------------------------------------------------------
+# Name: Award badges command
+# Purpose: This is a command file croning in background process regularly to
+# query database and award badges for user's special acitivities.
+#
+# Author: Mike
+#
+# Created: 18/01/2009
+# Copyright: (c) Mike 2009
+# Licence: GPL V2
+#-------------------------------------------------------------------------------
+#!/usr/bin/env python
+#encoding:utf-8
+from django.core.management.base import NoArgsCommand
+from django.db import connection
+from django.shortcuts import get_object_or_404
+from django.contrib.contenttypes.models import ContentType
+
+from forum.models import *
+
+class Command(NoArgsCommand):
+ def handle_noargs(self, **options):
+ try:
+ try:
+ self.clean_awards()
+ except Exception, e:
+ print e
+ finally:
+ connection.close()
+
+ def clean_awards(self):
+ Award.objects.all().delete()
+
+ award_type =ContentType.objects.get_for_model(Award)
+ Activity.objects.filter(content_type=award_type).delete()
+
+ for user in User.objects.all():
+ user.gold = 0
+ user.silver = 0
+ user.bronze = 0
+ user.save()
+
+ for badge in Badge.objects.all():
+ badge.awarded_count = 0
+ badge.save()
+
+ query = "UPDATE activity SET is_auditted = FALSE"
+ cursor = connection.cursor()
+ try:
+ cursor.execute(query)
+ finally:
+ cursor.close()
+ connection.close()
+
+def main():
+ pass
+
+if __name__ == '__main__':
+ main() \ No newline at end of file
diff --git a/forum/management/commands/pg_multi_award_badges.py b/forum/management/commands/pg_multi_award_badges.py
new file mode 100755
index 00000000..88bea762
--- /dev/null
+++ b/forum/management/commands/pg_multi_award_badges.py
@@ -0,0 +1,348 @@
+#!/usr/bin/env python
+#encoding:utf-8
+#-------------------------------------------------------------------------------
+# Name: Award badges command
+# Purpose: This is a command file croning in background process regularly to
+# query database and award badges for user's special acitivities.
+#
+# Author: Mike, Sailing
+#
+# Created: 22/01/2009
+# Copyright: (c) Mike 2009
+# Licence: GPL V2
+#-------------------------------------------------------------------------------
+
+from datetime import datetime, date
+from django.core.management.base import NoArgsCommand
+from django.db import connection
+from django.shortcuts import get_object_or_404
+from django.contrib.contenttypes.models import ContentType
+
+from forum.models import *
+from forum.const import *
+from pg_base_command import BaseCommand
+"""
+(1, '????', 3, '????', '?????3?????????', 1, 0),
+(2, '????', 3, '????', '?????3?????????', 1, 0),
+(3, '????', 3, '????', '????10???', 1, 0),
+(4, '????', 3, '????', '????10???', 1, 0),
+(5, '???', 3, '???', '??10???', 0, 0),
+(6, '????', 3, '????', '????????1000??', 1, 0),
+(7, '???', 3, '???', '?????????', 0, 0),
+(8, '???', 3, '???', '???????', 0, 0),
+(9, '???', 3, '???', '??????', 0, 0),
+(10, '??', 3, '??', '???????', 0, 0),
+(11, '??', 3, '??', '???????', 0, 0),
+(12, '??', 3, '??', '???????', 0, 0),
+(13, '??', 3, '??', '???????????????', 0, 0),
+(14, '???', 3, '???', '??????', 0, 0),
+(15, '??', 3, '??', '??????????????????', 0, 0),
+(16, '????', 3, '????', '????????????', 0, 0),
+(17, '????', 3, '????', '??????????3??????', 1, 0),
+(18, '??????', 1, '??????', '????100????', 1, 0),
+(19, '??????', 1, '??????', '????100????', 1, 0),
+(20, '???', 1, '???', '???100?????', 1, 0),
+(21, '????', 1, '????', '????????10000??', 1, 0),
+(22, 'alpha??', 2, 'alpha??', '?????????', 0, 0),
+(23, '????', 2, '????', '????25????', 1, 0),
+(24, '????', 2, '????', '????25????', 1, 0),
+(25, '?????', 2, '?????', '???25?????', 1, 0),
+(26, '????', 2, '????', '??300???', 0, 0),
+(27, '????', 2, '????', '???100???', 0, 0),
+(28, '??', 2, '??', '?????????', 0, 0),
+(29, '??', 2, '??', '???????????', 0, 0),
+(30, '??', 2, '??', '?????????', 0, 0),
+(31, '??????', 2, '??????', '????????2500??', 1, 0),
+(32, '???', 2, '???', '??????????10???', 0, 0),
+(33, 'beta??', 2, 'beta??', 'beta??????', 0, 0),
+(34, '??', 2, '??', '?????????????40??', 1, 0),
+(35, '??', 2, '??', '???60??????????5???', 1, 0),
+(36, '????', 2, '????', '??????50???????', 1, 0);
+
+
+TYPE_ACTIVITY_ASK_QUESTION=1
+TYPE_ACTIVITY_ANSWER=2
+TYPE_ACTIVITY_COMMENT_QUESTION=3
+TYPE_ACTIVITY_COMMENT_ANSWER=4
+TYPE_ACTIVITY_UPDATE_QUESTION=5
+TYPE_ACTIVITY_UPDATE_ANSWER=6
+TYPE_ACTIVITY_PRIZE=7
+TYPE_ACTIVITY_MARK_ANSWER=8
+TYPE_ACTIVITY_VOTE_UP=9
+TYPE_ACTIVITY_VOTE_DOWN=10
+TYPE_ACTIVITY_CANCEL_VOTE=11
+TYPE_ACTIVITY_DELETE_QUESTION=12
+TYPE_ACTIVITY_DELETE_ANSWER=13
+TYPE_ACTIVITY_MARK_OFFENSIVE=14
+TYPE_ACTIVITY_UPDATE_TAGS=15
+TYPE_ACTIVITY_FAVORITE=16
+TYPE_ACTIVITY_USER_FULL_UPDATED = 17
+"""
+
+class Command(BaseCommand):
+ def handle_noargs(self, **options):
+ try:
+ try:
+ self.delete_question_be_voted_up_3()
+ self.delete_answer_be_voted_up_3()
+ self.delete_question_be_vote_down_3()
+ self.delete_answer_be_voted_down_3()
+ self.answer_be_voted_up_10()
+ self.question_be_voted_up_10()
+ self.question_view_1000()
+ self.answer_self_question_be_voted_up_3()
+ self.answer_be_voted_up_100()
+ self.question_be_voted_up_100()
+ self.question_be_favorited_100()
+ self.question_view_10000()
+ self.answer_be_voted_up_25()
+ self.question_be_voted_up_25()
+ self.question_be_favorited_25()
+ self.question_view_2500()
+ self.answer_be_accepted_and_voted_up_40()
+ self.question_be_answered_after_60_days_and_be_voted_up_5()
+ self.created_tag_be_used_in_question_50()
+ except Exception, e:
+ print e
+ finally:
+ connection.close()
+
+ def delete_question_be_voted_up_3(self):
+ """
+ (1, '????', 3, '????', '?????3?????????', 1, 0),
+ """
+ query = "SELECT act.id, act.user_id, act.object_id FROM activity act, question q WHERE act.object_id = q.id AND\
+ act.activity_type = %s AND\
+ q.vote_up_count >=3 AND \
+ not act.is_auditted" % (TYPE_ACTIVITY_DELETE_QUESTION)
+ self.__process_activities_badge(query, 1, Question)
+
+ def delete_answer_be_voted_up_3(self):
+ """
+ (1, '????', 3, '????', '?????3?????????', 1, 0),
+ """
+ query = "SELECT act.id, act.user_id, act.object_id FROM activity act, answer an WHERE act.object_id = an.id AND\
+ act.activity_type = %s AND\
+ an.vote_up_count >=3 AND \
+ not act.is_auditted" % (TYPE_ACTIVITY_DELETE_ANSWER)
+ self.__process_activities_badge(query, 1, Answer)
+
+ def delete_question_be_vote_down_3(self):
+ """
+ (2, '????', 3, '????', '?????3?????????', 1, 0),
+ """
+ query = "SELECT act.id, act.user_id, act.object_id FROM activity act, question q WHERE act.object_id = q.id AND\
+ act.activity_type = %s AND\
+ q.vote_down_count >=3 AND \
+ not act.is_auditted" % (TYPE_ACTIVITY_DELETE_QUESTION)
+ content_type = ContentType.objects.get_for_model(Question)
+ self.__process_activities_badge(query, 2, Question)
+
+ def delete_answer_be_voted_down_3(self):
+ """
+ (2, '????', 3, '????', '?????3?????????', 1, 0),
+ """
+ query = "SELECT act.id, act.user_id, act.object_id FROM activity act, answer an WHERE act.object_id = an.id AND\
+ act.activity_type = %s AND\
+ an.vote_down_count >=3 AND \
+ not act.is_auditted" % (TYPE_ACTIVITY_DELETE_ANSWER)
+ self.__process_activities_badge(query, 2, Answer)
+
+ def answer_be_voted_up_10(self):
+ """
+ (3, '????', 3, '????', '????10???', 1, 0),
+ """
+ query = "SELECT act.id, act.user_id, act.object_id FROM \
+ activity act, answer a WHERE act.object_id = a.id AND\
+ act.activity_type = %s AND \
+ a.vote_up_count >= 10 AND\
+ not act.is_auditted" % (TYPE_ACTIVITY_ANSWER)
+ self.__process_activities_badge(query, 3, Answer)
+
+ def question_be_voted_up_10(self):
+ """
+ (4, '????', 3, '????', '????10???', 1, 0),
+ """
+ query = "SELECT act.id, act.user_id, act.object_id FROM \
+ activity act, question q WHERE act.object_id = q.id AND\
+ act.activity_type = %s AND \
+ q.vote_up_count >= 10 AND\
+ not act.is_auditted" % (TYPE_ACTIVITY_ASK_QUESTION)
+ self.__process_activities_badge(query, 4, Question)
+
+ def question_view_1000(self):
+ """
+ (6, '????', 3, '????', '????????1000??', 1, 0),
+ """
+ query = "SELECT act.id, act.user_id, act.object_id FROM \
+ activity act, question q WHERE act.activity_type = %s AND\
+ act.object_id = q.id AND \
+ q.view_count >= 1000 AND\
+ act.object_id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (TYPE_ACTIVITY_ASK_QUESTION, 6)
+ self.__process_activities_badge(query, 6, Question, False)
+
+ def answer_self_question_be_voted_up_3(self):
+ """
+ (17, '????', 3, '????', '??????????3??????', 1, 0),
+ """
+ query = "SELECT act.id, act.user_id, act.object_id FROM \
+ activity act, answer an WHERE act.activity_type = %s AND\
+ act.object_id = an.id AND\
+ an.vote_up_count >= 3 AND\
+ act.user_id = (SELECT user_id FROM question q WHERE q.id = an.question_id) AND\
+ act.object_id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 17)
+ self.__process_activities_badge(query, 17, Question, False)
+
+ def answer_be_voted_up_100(self):
+ """
+ (18, '??????', 1, '??????', '????100????', 1, 0),
+ """
+ query = "SELECT an.id, an.author_id FROM answer an WHERE an.vote_up_count >= 100 AND an.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (18)
+
+ self.__process_badge(query, 18, Answer)
+
+ def question_be_voted_up_100(self):
+ """
+ (19, '??????', 1, '??????', '????100????', 1, 0),
+ """
+ query = "SELECT q.id, q.author_id FROM question q WHERE q.vote_up_count >= 100 AND q.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (19)
+
+ self.__process_badge(query, 19, Question)
+
+ def question_be_favorited_100(self):
+ """
+ (20, '???', 1, '???', '???100?????', 1, 0),
+ """
+ query = "SELECT q.id, q.author_id FROM question q WHERE q.favourite_count >= 100 AND q.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (20)
+
+ self.__process_badge(query, 20, Question)
+
+ def question_view_10000(self):
+ """
+ (21, '????', 1, '????', '????????10000??', 1, 0),
+ """
+ query = "SELECT q.id, q.author_id FROM question q WHERE q.view_count >= 10000 AND q.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (21)
+
+ self.__process_badge(query, 21, Question)
+
+ def answer_be_voted_up_25(self):
+ """
+ (23, '????', 2, '????', '????25????', 1, 0),
+ """
+ query = "SELECT a.id, a.author_id FROM answer a WHERE a.vote_up_count >= 25 AND a.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (23)
+
+ self.__process_badge(query, 23, Answer)
+
+ def question_be_voted_up_25(self):
+ """
+ (24, '????', 2, '????', '????25????', 1, 0),
+ """
+ query = "SELECT q.id, q.author_id FROM question q WHERE q.vote_up_count >= 25 AND q.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (24)
+
+ self.__process_badge(query, 24, Question)
+
+ def question_be_favorited_25(self):
+ """
+ (25, '?????', 2, '?????', '???25?????', 1, 0),
+ """
+ query = "SELECT q.id, q.author_id FROM question q WHERE q.favourite_count >= 25 AND q.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (25)
+
+ self.__process_badge(query, 25, Question)
+
+ def question_view_2500(self):
+ """
+ (31, '??????', 2, '??????', '????????2500??', 1, 0),
+ """
+ query = "SELECT q.id, q.author_id FROM question q WHERE q.view_count >= 2500 AND q.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (31)
+
+ self.__process_badge(query, 31, Question)
+
+ def answer_be_accepted_and_voted_up_40(self):
+ """
+ (34, '??', 2, '??', '?????????????40??', 1, 0),
+ """
+ query = "SELECT a.id, a.author_id FROM answer a WHERE a.vote_up_count >= 40 AND\
+ a.accepted AND\
+ a.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (34)
+
+ self.__process_badge(query, 34, Answer)
+
+ def question_be_answered_after_60_days_and_be_voted_up_5(self):
+ """
+ (35, '??', 2, '??', '???60??????????5???', 1, 0),
+ """
+ query = "SELECT a.id, a.author_id FROM question q, answer a WHERE q.id = a.question_id AND\
+ (a.added_at + '60 day'::INTERVAL) >= q.added_at AND\
+ a.vote_up_count >= 5 AND \
+ a.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (35)
+
+ self.__process_badge(query, 35, Answer)
+
+ def created_tag_be_used_in_question_50(self):
+ """
+ (36, '????', 2, '????', '??????50???????', 1, 0);
+ """
+ query = "SELECT t.id, t.created_by_id FROM tag t, auth_user u WHERE t.created_by_id = u.id AND \
+ t. used_count >= 50 AND \
+ t.id NOT IN \
+ (SELECT object_id FROM award WHERE award.badge_id = %s)" % (36)
+
+ self.__process_badge(query, 36, Tag)
+
+ def __process_activities_badge(self, query, badge, content_object, update_auditted=True):
+ content_type = ContentType.objects.get_for_model(content_object)
+
+ cursor = connection.cursor()
+ try:
+ cursor.execute(query)
+ rows = cursor.fetchall()
+
+ if update_auditted:
+ activity_ids = []
+ badge = get_object_or_404(Badge, id=badge)
+ for row in rows:
+ activity_id = row[0]
+ user_id = row[1]
+ object_id = row[2]
+
+ user = get_object_or_404(User, id=user_id)
+ award = Award(user=user, badge=badge, content_type=content_type, object_id=object_id)
+ award.save()
+
+ if update_auditted:
+ activity_ids.append(activity_id)
+
+ if update_auditted:
+ self.update_activities_auditted(cursor, activity_ids)
+ finally:
+ cursor.close()
+
+ def __process_badge(self, query, badge, content_object):
+ content_type = ContentType.objects.get_for_model(Answer)
+ cursor = connection.cursor()
+ try:
+ cursor.execute(query)
+ rows = cursor.fetchall()
+
+ badge = get_object_or_404(Badge, id=badge)
+ for row in rows:
+ object_id = row[0]
+ user_id = row[1]
+
+ user = get_object_or_404(User, id=user_id)
+ award = Award(user=user, badge=badge, content_type=content_type, object_id=object_id)
+ award.save()
+ finally:
+ cursor.close()
diff --git a/forum/management/commands/pg_once_award_badges.py b/forum/management/commands/pg_once_award_badges.py
new file mode 100755
index 00000000..3dd6646c
--- /dev/null
+++ b/forum/management/commands/pg_once_award_badges.py
@@ -0,0 +1,350 @@
+#!/usr/bin/env python
+#encoding:utf-8
+#-------------------------------------------------------------------------------
+# Name: Award badges command
+# Purpose: This is a command file croning in background process regularly to
+# query database and award badges for user's special acitivities.
+#
+# Author: Mike, Sailing
+#
+# Created: 18/01/2009
+# Copyright: (c) Mike 2009
+# Licence: GPL V2
+#-------------------------------------------------------------------------------
+
+from datetime import datetime, date
+from django.db import connection
+from django.shortcuts import get_object_or_404
+from django.contrib.contenttypes.models import ContentType
+
+from forum.models import *
+from forum.const import *
+from pg_base_command import BaseCommand
+"""
+(1, '????', 3, '????', '?????3?????????', 1, 0),
+(2, '????', 3, '????', '?????3?????????', 1, 0),
+(3, '????', 3, '????', '????10???', 1, 0),
+(4, '????', 3, '????', '????10???', 1, 0),
+(5, '???', 3, '???', '??10???', 0, 0),
+(6, '????', 3, '????', '????????1000??', 1, 0),
+(7, '???', 3, '???', '?????????', 0, 0),
+(8, '???', 3, '???', '???????', 0, 0),
+(9, '???', 3, '???', '??????', 0, 0),
+(10, '??', 3, '??', '???????', 0, 0),
+(11, '??', 3, '??', '???????', 0, 0),
+(12, '??', 3, '??', '???????', 0, 0),
+(13, '??', 3, '??', '???????????????', 0, 0),
+(14, '???', 3, '???', '??????', 0, 0),
+(15, '??', 3, '??', '??????????????????', 0, 0),
+(16, '????', 3, '????', '????????????', 0, 0),
+(17, '????', 3, '????', '??????????3??????', 1, 0),
+(18, '??????', 1, '??????', '????100????', 1, 0),
+(19, '??????', 1, '??????', '????100????', 1, 0),
+(20, '???', 1, '???', '???100?????', 1, 0),
+(21, '????', 1, '????', '????????10000??', 1, 0),
+(22, 'alpha??', 2, 'alpha??', '?????????', 0, 0),
+(23, '????', 2, '????', '????25????', 1, 0),
+(24, '????', 2, '????', '????25????', 1, 0),
+(25, '?????', 2, '?????', '???25?????', 1, 0),
+(26, '????', 2, '????', '??300???', 0, 0),
+(27, '????', 2, '????', '???100???', 0, 0),
+(28, '??', 2, '??', '?????????', 0, 0),
+(29, '??', 2, '??', '???????????', 0, 0),
+(30, '??', 2, '??', '?????????', 0, 0),
+(31, '??????', 2, '??????', '????????2500??', 1, 0),
+(32, '???', 2, '???', '??????????10???', 0, 0),
+(33, 'beta??', 2, 'beta??', 'beta??????', 0, 0),
+(34, '??', 2, '??', '?????????????40??', 1, 0),
+(35, '??', 2, '??', '???60??????????5???', 1, 0),
+(36, '????', 2, '????', '??????50???????', 1, 0);
+
+
+TYPE_ACTIVITY_ASK_QUESTION=1
+TYPE_ACTIVITY_ANSWER=2
+TYPE_ACTIVITY_COMMENT_QUESTION=3
+TYPE_ACTIVITY_COMMENT_ANSWER=4
+TYPE_ACTIVITY_UPDATE_QUESTION=5
+TYPE_ACTIVITY_UPDATE_ANSWER=6
+TYPE_ACTIVITY_PRIZE=7
+TYPE_ACTIVITY_MARK_ANSWER=8
+TYPE_ACTIVITY_VOTE_UP=9
+TYPE_ACTIVITY_VOTE_DOWN=10
+TYPE_ACTIVITY_CANCEL_VOTE=11
+TYPE_ACTIVITY_DELETE_QUESTION=12
+TYPE_ACTIVITY_DELETE_ANSWER=13
+TYPE_ACTIVITY_MARK_OFFENSIVE=14
+TYPE_ACTIVITY_UPDATE_TAGS=15
+TYPE_ACTIVITY_FAVORITE=16
+TYPE_ACTIVITY_USER_FULL_UPDATED = 17
+"""
+
+BADGE_AWARD_TYPE_FIRST = {
+ TYPE_ACTIVITY_MARK_OFFENSIVE : 7,
+ TYPE_ACTIVITY_CANCEL_VOTE: 8,
+ TYPE_ACTIVITY_VOTE_DOWN : 9,
+ TYPE_ACTIVITY_UPDATE_QUESTION : 10,
+ TYPE_ACTIVITY_UPDATE_ANSWER : 10,
+ TYPE_ACTIVITY_UPDATE_TAGS : 11,
+ TYPE_ACTIVITY_MARK_ANSWER : 12,
+ TYPE_ACTIVITY_VOTE_UP : 14,
+ TYPE_ACTIVITY_USER_FULL_UPDATED: 16
+
+}
+
+class Command(BaseCommand):
+ def handle_noargs(self, **options):
+ try:
+ try:
+ self.alpha_user()
+ self.beta_user()
+ self.first_type_award()
+ self.first_ask_be_voted()
+ self.first_answer_be_voted()
+ self.first_answer_be_voted_10()
+ self.vote_count_300()
+ self.edit_count_100()
+ self.comment_count_10()
+ except Exception, e:
+ print e
+ finally:
+ connection.close()
+
+ def alpha_user(self):
+ """
+ Before Jan 25, 2009(Chinese New Year Eve and enter into Beta for CNProg), every registered user
+ will be awarded the "Alpha" badge if he has any activities.
+ """
+ alpha_end_date = date(2009, 1, 25)
+ if date.today() < alpha_end_date:
+ badge = get_object_or_404(Badge, id=22)
+ for user in User.objects.all():
+ award = Award.objects.filter(user=user, badge=badge)
+ if award and not badge.multiple:
+ continue
+ activities = Activity.objects.filter(user=user)
+ if len(activities) > 0:
+ new_award = Award(user=user, badge=badge)
+ new_award.save()
+
+ def beta_user(self):
+ """
+ Before Feb 25, 2009, every registered user
+ will be awarded the "Beta" badge if he has any activities.
+ """
+ beta_end_date = date(2009, 2, 25)
+ if date.today() < beta_end_date:
+ badge = get_object_or_404(Badge, id=33)
+ for user in User.objects.all():
+ award = Award.objects.filter(user=user, badge=badge)
+ if award and not badge.multiple:
+ continue
+ activities = Activity.objects.filter(user=user)
+ if len(activities) > 0:
+ new_award = Award(user=user, badge=badge)
+ new_award.save()
+
+ def first_type_award(self):
+ """
+ This will award below badges for users first behaviors:
+
+ (7, '???', 3, '???', '?????????', 0, 0),
+ (8, '???', 3, '???', '???????', 0, 0),
+ (9, '???', 3, '???', '??????', 0, 0),
+ (10, '??', 3, '??', '???????', 0, 0),
+ (11, '??', 3, '??', '???????', 0, 0),
+ (12, '??', 3, '??', '???????', 0, 0),
+ (14, '???', 3, '???', '??????', 0, 0),
+ (16, '????', 3, '????', '????????????', 0, 0),
+ """
+ activity_types = ','.join('%s' % item for item in BADGE_AWARD_TYPE_FIRST.keys())
+ # ORDER BY user_id, activity_type
+ query = "SELECT id, user_id, activity_type, content_type_id, object_id FROM activity WHERE not is_auditted AND activity_type IN (%s) ORDER BY user_id, activity_type" % activity_types
+
+ cursor = connection.cursor()
+ try:
+ cursor.execute(query)
+ rows = cursor.fetchall()
+ # collect activity_id in current process
+ activity_ids = []
+ last_user_id = 0
+ last_activity_type = 0
+ for row in rows:
+ activity_ids.append(row[0])
+ user_id = row[1]
+ activity_type = row[2]
+ content_type_id = row[3]
+ object_id = row[4]
+
+ # if the user and activity are same as the last, continue
+ if user_id == last_user_id and activity_type == last_activity_type:
+ continue;
+
+ user = get_object_or_404(User, id=user_id)
+ badge = get_object_or_404(Badge, id=BADGE_AWARD_TYPE_FIRST[activity_type])
+ content_type = get_object_or_404(ContentType, id=content_type_id)
+
+ count = Award.objects.filter(user=user, badge=badge).count()
+ if count and not badge.multiple:
+ continue
+ else:
+ # new award
+ award = Award(user=user, badge=badge, content_type=content_type, object_id=object_id)
+ award.save()
+
+ # set the current user_id and activity_type to last
+ last_user_id = user_id
+ last_activity_type = activity_type
+
+ # update processed rows to auditted
+ self.update_activities_auditted(cursor, activity_ids)
+ finally:
+ cursor.close()
+
+ def first_ask_be_voted(self):
+ """
+ For user asked question and got first upvote, we award him following badge:
+
+ (13, '??', 3, '??', '???????????????', 0, 0),
+ """
+ query = "SELECT act.user_id, q.vote_up_count, act.object_id FROM " \
+ "activity act, question q WHERE act.activity_type = %s AND " \
+ "act.object_id = q.id AND " \
+ "act.user_id NOT IN (SELECT distinct user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ASK_QUESTION, 13)
+ cursor = connection.cursor()
+ try:
+ cursor.execute(query)
+ rows = cursor.fetchall()
+
+ badge = get_object_or_404(Badge, id=13)
+ content_type = ContentType.objects.get_for_model(Question)
+ awarded_users = []
+ for row in rows:
+ user_id = row[0]
+ vote_up_count = row[1]
+ object_id = row[2]
+ if vote_up_count > 0 and user_id not in awarded_users:
+ user = get_object_or_404(User, id=user_id)
+ award = Award(user=user, badge=badge, content_type=content_type, object_id=object_id)
+ award.save()
+ awarded_users.append(user_id)
+ finally:
+ cursor.close()
+
+ def first_answer_be_voted(self):
+ """
+ When user answerd questions and got first upvote, we award him following badge:
+
+ (15, '??', 3, '??', '??????????????????', 0, 0),
+ """
+ query = "SELECT act.user_id, a.vote_up_count, act.object_id FROM " \
+ "activity act, answer a WHERE act.activity_type = %s AND " \
+ "act.object_id = a.id AND " \
+ "act.user_id NOT IN (SELECT distinct user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 15)
+ cursor = connection.cursor()
+ try:
+ cursor.execute(query)
+ rows = cursor.fetchall()
+
+ awarded_users = []
+ badge = get_object_or_404(Badge, id=15)
+ content_type = ContentType.objects.get_for_model(Answer)
+ for row in rows:
+ user_id = row[0]
+ vote_up_count = row[1]
+ object_id = row[2]
+ if vote_up_count > 0 and user_id not in awarded_users:
+ user = get_object_or_404(User, id=user_id)
+ award = Award(user=user, badge=badge, content_type=content_type, object_id=object_id)
+ award.save()
+ awarded_users.append(user_id)
+ finally:
+ cursor.close()
+
+ def first_answer_be_voted_10(self):
+ """
+ (32, '???', 2, '???', '??????????10???', 0, 0)
+ """
+ query = "SELECT act.user_id, act.object_id FROM " \
+ "activity act, answer a WHERE act.object_id = a.id AND " \
+ "act.activity_type = %s AND " \
+ "a.vote_up_count >= 10 AND " \
+ "act.user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s)" % (TYPE_ACTIVITY_ANSWER, 32)
+ cursor = connection.cursor()
+ try:
+ cursor.execute(query)
+ rows = cursor.fetchall()
+
+ awarded_users = []
+ badge = get_object_or_404(Badge, id=32)
+ content_type = ContentType.objects.get_for_model(Answer)
+ for row in rows:
+ user_id = row[0]
+ if user_id not in awarded_users:
+ user = get_object_or_404(User, id=user_id)
+ object_id = row[1]
+ award = Award(user=user, badge=badge, content_type=content_type, object_id=object_id)
+ award.save()
+ awarded_users.append(user_id)
+ finally:
+ cursor.close()
+
+ def vote_count_300(self):
+ """
+ (26, '????', 2, '????', '??300???', 0, 0)
+ """
+ query = "SELECT count(*) as vote_count, user_id FROM activity WHERE " \
+ "activity_type = %s OR " \
+ "activity_type = %s AND " \
+ "user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) " \
+ "GROUP BY user_id HAVING count(*) >= 300" % (TYPE_ACTIVITY_VOTE_UP, TYPE_ACTIVITY_VOTE_DOWN, 26)
+
+ self.__award_for_count_num(query, 26)
+
+ def edit_count_100(self):
+ """
+ (27, '????', 2, '????', '???100???', 0, 0)
+ """
+ query = "SELECT count(*) as vote_count, user_id FROM activity WHERE " \
+ "activity_type = %s OR " \
+ "activity_type = %s AND " \
+ "user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) " \
+ "GROUP BY user_id HAVING count(*) >= 100" % (TYPE_ACTIVITY_UPDATE_QUESTION, TYPE_ACTIVITY_UPDATE_ANSWER, 27)
+
+ self.__award_for_count_num(query, 27)
+
+ def comment_count_10(self):
+ """
+ (5, '???', 3, '???', '??10???', 0, 0),
+ """
+ query = "SELECT count(*) as vote_count, user_id FROM activity WHERE " \
+ "activity_type = %s OR " \
+ "activity_type = %s AND " \
+ "user_id NOT IN (SELECT user_id FROM award WHERE badge_id = %s) " \
+ "GROUP BY user_id HAVING count(*) >= 10" % (TYPE_ACTIVITY_COMMENT_QUESTION, TYPE_ACTIVITY_COMMENT_ANSWER, 5)
+ self.__award_for_count_num(query, 5)
+
+ def __award_for_count_num(self, query, badge):
+ cursor = connection.cursor()
+ try:
+ cursor.execute(query)
+ rows = cursor.fetchall()
+
+ awarded_users = []
+ badge = get_object_or_404(Badge, id=badge)
+ for row in rows:
+ vote_count = row[0]
+ user_id = row[1]
+
+ if user_id not in awarded_users:
+ user = get_object_or_404(User, id=user_id)
+ award = Award(user=user, badge=badge)
+ award.save()
+ awarded_users.append(user_id)
+ finally:
+ cursor.close()
+
+def main():
+ pass
+
+if __name__ == '__main__':
+ main()
diff --git a/forum/models/__init__.py b/forum/models/__init__.py
index 3998021b..09f5627f 100755
--- a/forum/models/__init__.py
+++ b/forum/models/__init__.py
@@ -205,7 +205,7 @@ def notify_award_message(instance, created, **kwargs):
+ u"Check out <a href=\"%s\">your profile</a>.") \
% (instance.badge.name, user.get_profile_url())
- user.message_set.create(message=message)
+ user.message_set.create(message=msg)
def record_answer_accepted(instance, created, **kwargs):
"""