From f0524f6614d145ee8031cf381342c56e1f065335 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Fri, 10 Jul 2009 19:13:45 -0400 Subject: deleted all --- .gitignore | 3 - INSTALL | 33 - LICENSE | 12 - __init__.py | 0 cnprog.wsgi | 8 - context.py | 9 - development.log | 1 - django_authopenid/__init__.py | 40 - django_authopenid/admin.py | 9 - django_authopenid/forms.py | 435 --- django_authopenid/middleware.py | 24 - django_authopenid/mimeparse.py | 160 - django_authopenid/models.py | 71 - django_authopenid/urls.py | 27 - django_authopenid/util.py | 145 - django_authopenid/views.py | 787 ----- forum/__init__.py | 0 forum/admin.py | 71 - forum/auth.py | 443 --- forum/const.py | 87 - forum/diff.py | 66 - forum/feed.py | 43 - forum/forms.py | 193 -- forum/management/__init__.py | 0 forum/management/commands/__init__.py | 0 forum/management/commands/base_command.py | 35 - forum/management/commands/clean_award_badges.py | 58 - forum/management/commands/multi_award_badges.py | 347 -- forum/management/commands/once_award_badges.py | 327 -- forum/management/commands/sample_command.py | 7 - forum/managers.py | 208 -- forum/models.py | 653 ---- forum/templatetags/__init__.py | 0 forum/templatetags/extra_filters.py | 83 - forum/templatetags/extra_tags.py | 240 -- forum/user.py | 74 - forum/views.py | 1962 ----------- junk | 7 - lanai.psproj | 557 --- locale/en/LC_MESSAGES/django.po | 2540 -------------- locale/zh-cn/LC_MESSAGES/django.mo | Bin 39094 -> 0 bytes locale/zh-cn/LC_MESSAGES/django.po | 1430 -------- locale/zh_CN/LC_MESSAGES/django.mo | Bin 8581 -> 0 bytes locale/zh_CN/LC_MESSAGES/django.po | 594 ---- log/cnprog.log | 0 manage.py | 11 - middleware/__init__.py | 0 middleware/pagesize.py | 29 - settings.py | 146 - settings_local.py.dist | 25 - sql_scripts/cnprog.xml | 1498 --------- sql_scripts/cnprog_new_install.sql | 811 ----- sql_scripts/cnprog_new_install_2009_02_28.sql | 456 --- sql_scripts/cnprog_new_install_2009_03_31.sql | 891 ----- sql_scripts/cnprog_new_install_2009_04_07.sql | 24 - sql_scripts/cnprog_new_install_2009_04_09.sql | 904 ----- sql_scripts/update_2009_01_13_001.sql | 62 - sql_scripts/update_2009_01_13_002.sql | 1 - sql_scripts/update_2009_01_18_001.sql | 62 - sql_scripts/update_2009_01_24.sql | 2 - sql_scripts/update_2009_01_25_001.sql | 2 - sql_scripts/update_2009_02_26_001.sql | 19 - sql_scripts/update_2009_04_10_001.sql | 3 - sql_scripts/update_2009_12_24_001.sql | 5 - sql_scripts/update_2009_12_27_001.sql | 3 - sql_scripts/update_2009_12_27_002.sql | 1 - templates/404.html | 49 - templates/500.html | 35 - templates/about.html | 21 - templates/allfiles | 30 - templates/answer_edit.html | 88 - templates/answer_edit_tips.html | 54 - templates/ask.html | 140 - templates/authopenid/changeemail.html | 35 - templates/authopenid/changeopenid.html | 33 - templates/authopenid/changepw.html | 33 - templates/authopenid/complete.html | 67 - templates/authopenid/confirm_email.txt | 12 - templates/authopenid/delete.html | 38 - templates/authopenid/failure.html | 13 - templates/authopenid/htmlfiles | 8 - templates/authopenid/sendpw.html | 34 - templates/authopenid/sendpw_email.txt | 14 - templates/authopenid/settings.html | 41 - templates/authopenid/signin.html | 95 - templates/authopenid/signup.html | 52 - templates/authopenid/yadis.xrdf | 14 - templates/badge.html | 37 - templates/badges.html | 78 - templates/base.html | 91 - templates/base_content.html | 86 - templates/book.html | 152 - templates/close.html | 36 - templates/content/images/box-arrow.gif | Bin 69 -> 0 bytes templates/content/images/bullet_green.gif | Bin 64 -> 0 bytes templates/content/images/cc-88x31.png | Bin 5460 -> 0 bytes templates/content/images/cc-wiki.png | Bin 2333 -> 0 bytes templates/content/images/close-small-hover.png | Bin 337 -> 0 bytes templates/content/images/close-small.png | Bin 293 -> 0 bytes templates/content/images/cnprog_logo_200_56.gif | Bin 2114 -> 0 bytes templates/content/images/dash.gif | Bin 44 -> 0 bytes templates/content/images/djangomade124x25_grey.gif | Bin 2035 -> 0 bytes templates/content/images/dot-g.gif | Bin 61 -> 0 bytes templates/content/images/dot-list.gif | Bin 56 -> 0 bytes templates/content/images/edit.png | Bin 758 -> 0 bytes templates/content/images/expander-arrow-hide.gif | Bin 126 -> 0 bytes templates/content/images/expander-arrow-show.gif | Bin 135 -> 0 bytes templates/content/images/favicon.gif | Bin 3918 -> 0 bytes templates/content/images/favicon.ico | Bin 3638 -> 0 bytes templates/content/images/feed-icon-small.png | Bin 689 -> 0 bytes templates/content/images/grippie.png | Bin 162 -> 0 bytes templates/content/images/indicator.gif | Bin 2545 -> 0 bytes templates/content/images/logo.png | Bin 3631 -> 0 bytes templates/content/images/logo1.png | Bin 2752 -> 0 bytes templates/content/images/logo2.png | Bin 2124 -> 0 bytes templates/content/images/medala.gif | Bin 801 -> 0 bytes templates/content/images/medala_on.gif | Bin 957 -> 0 bytes templates/content/images/new.gif | Bin 635 -> 0 bytes templates/content/images/nophoto.png | Bin 696 -> 0 bytes templates/content/images/openid.gif | Bin 910 -> 0 bytes templates/content/images/openid/aol.gif | Bin 2205 -> 0 bytes templates/content/images/openid/blogger.ico | Bin 3638 -> 0 bytes templates/content/images/openid/claimid.ico | Bin 3638 -> 0 bytes templates/content/images/openid/facebook.gif | Bin 2075 -> 0 bytes templates/content/images/openid/flickr.ico | Bin 1150 -> 0 bytes templates/content/images/openid/google.gif | Bin 1596 -> 0 bytes templates/content/images/openid/livejournal.ico | Bin 5222 -> 0 bytes templates/content/images/openid/myopenid.ico | Bin 2862 -> 0 bytes .../content/images/openid/openid-inputicon.gif | Bin 237 -> 0 bytes templates/content/images/openid/openid.gif | Bin 740 -> 0 bytes templates/content/images/openid/technorati.ico | Bin 2294 -> 0 bytes templates/content/images/openid/verisign.ico | Bin 4710 -> 0 bytes templates/content/images/openid/vidoop.ico | Bin 1406 -> 0 bytes templates/content/images/openid/wordpress.ico | Bin 1150 -> 0 bytes templates/content/images/openid/yahoo.gif | Bin 1682 -> 0 bytes templates/content/images/quest-bg.gif | Bin 294 -> 0 bytes templates/content/images/vote-accepted-on.png | Bin 1124 -> 0 bytes templates/content/images/vote-accepted.png | Bin 1058 -> 0 bytes templates/content/images/vote-arrow-down-on.png | Bin 905 -> 0 bytes templates/content/images/vote-arrow-down.png | Bin 876 -> 0 bytes templates/content/images/vote-arrow-up-on.png | Bin 906 -> 0 bytes templates/content/images/vote-arrow-up.png | Bin 843 -> 0 bytes templates/content/images/vote-favorite-off.png | Bin 930 -> 0 bytes templates/content/images/vote-favorite-on.png | Bin 1023 -> 0 bytes templates/content/js/com.cnprog.editor.js | 68 - templates/content/js/com.cnprog.i18n.js | 90 - templates/content/js/com.cnprog.post.js | 616 ---- templates/content/js/com.cnprog.post.pack.js | 1 - templates/content/js/com.cnprog.utils.js | 122 - templates/content/js/compress.bat | 6 - templates/content/js/excanvas.pack.js | 1 - templates/content/js/flot-build.bat | 3 - templates/content/js/jquery-1.2.6.js | 3549 -------------------- templates/content/js/jquery-1.2.6.min.js | 32 - templates/content/js/jquery.ajaxfileupload.js | 195 -- templates/content/js/jquery.flot.js | 2421 ------------- templates/content/js/jquery.flot.pack.js | 1 - templates/content/js/jquery.i18n.js | 133 - templates/content/js/jquery.openid.js | 176 - templates/content/js/jquery.validate.pack.js | 15 - templates/content/js/se_hilite.js | 1 - templates/content/js/se_hilite_src.js | 273 -- templates/content/js/wmd/images/wmd-buttons.png | Bin 7465 -> 0 bytes templates/content/js/wmd/showdown-min.js | 1 - templates/content/js/wmd/showdown.js | 1309 -------- templates/content/js/wmd/wmd-min.js | 1 - templates/content/js/wmd/wmd-test.html | 158 - templates/content/js/wmd/wmd.css | 129 - templates/content/js/wmd/wmd.js | 2388 ------------- templates/content/js/yuicompressor-2.4.2.jar | Bin 851219 -> 0 bytes templates/content/style/default.css | 1753 ---------- templates/content/style/jquery.autocomplete.css | 49 - templates/content/style/openid.css | 45 - templates/content/style/prettify.css | 27 - templates/content/style/style.css | 1044 ------ templates/faq.html | 113 - templates/feeds/rss_description.html | 1 - templates/feeds/rss_title.html | 1 - templates/footer.html | 33 - templates/header.html | 70 - templates/index.html | 123 - templates/logout.html | 25 - templates/okfiles | 30 - templates/pagesize.html | 27 - templates/paginator.html | 39 - templates/privacy.html | 43 - templates/question.html | 510 --- templates/question_edit.html | 134 - templates/question_edit_tips.html | 51 - templates/question_retag.html | 109 - templates/questions.html | 158 - templates/reopen.html | 40 - templates/revisions_answer.html | 102 - templates/revisions_question.html | 103 - templates/tags.html | 64 - templates/template.list | 18 - templates/tough/faq.html | 110 - templates/tough/question_retag.html | 107 - templates/tough/unanswered.html | 115 - templates/unanswered.html | 120 - templates/upfiles/1245715031297631.png | Bin 3863 -> 0 bytes templates/upfiles/12457157052552259.png | Bin 3863 -> 0 bytes templates/user.html | 35 - templates/user_edit.html | 91 - templates/user_favorites.html | 9 - templates/user_footer.html | 4 - templates/user_info.html | 90 - templates/user_preferences.html | 11 - templates/user_recent.html | 27 - templates/user_reputation.html | 41 - templates/user_responses.html | 23 - templates/user_stats.html | 134 - templates/user_tabs.html | 34 - templates/user_votes.html | 31 - templates/users.html | 73 - templates/users_questions.html | 66 - urls.py | 63 - utils/__init__.py | 0 utils/cache.py | 92 - utils/html.py | 51 - utils/lists.py | 86 - 221 files changed, 35944 deletions(-) delete mode 100644 .gitignore delete mode 100644 INSTALL delete mode 100644 LICENSE delete mode 100644 __init__.py delete mode 100644 cnprog.wsgi delete mode 100644 context.py delete mode 100644 development.log delete mode 100644 django_authopenid/__init__.py delete mode 100644 django_authopenid/admin.py delete mode 100644 django_authopenid/forms.py delete mode 100644 django_authopenid/middleware.py delete mode 100644 django_authopenid/mimeparse.py delete mode 100644 django_authopenid/models.py delete mode 100644 django_authopenid/urls.py delete mode 100644 django_authopenid/util.py delete mode 100644 django_authopenid/views.py delete mode 100644 forum/__init__.py delete mode 100644 forum/admin.py delete mode 100644 forum/auth.py delete mode 100644 forum/const.py delete mode 100644 forum/diff.py delete mode 100644 forum/feed.py delete mode 100644 forum/forms.py delete mode 100644 forum/management/__init__.py delete mode 100644 forum/management/commands/__init__.py delete mode 100644 forum/management/commands/base_command.py delete mode 100644 forum/management/commands/clean_award_badges.py delete mode 100644 forum/management/commands/multi_award_badges.py delete mode 100644 forum/management/commands/once_award_badges.py delete mode 100644 forum/management/commands/sample_command.py delete mode 100644 forum/managers.py delete mode 100644 forum/models.py delete mode 100644 forum/templatetags/__init__.py delete mode 100644 forum/templatetags/extra_filters.py delete mode 100644 forum/templatetags/extra_tags.py delete mode 100644 forum/user.py delete mode 100644 forum/views.py delete mode 100644 junk delete mode 100644 lanai.psproj delete mode 100644 locale/en/LC_MESSAGES/django.po delete mode 100644 locale/zh-cn/LC_MESSAGES/django.mo delete mode 100644 locale/zh-cn/LC_MESSAGES/django.po delete mode 100644 locale/zh_CN/LC_MESSAGES/django.mo delete mode 100644 locale/zh_CN/LC_MESSAGES/django.po delete mode 100644 log/cnprog.log delete mode 100644 manage.py delete mode 100644 middleware/__init__.py delete mode 100644 middleware/pagesize.py delete mode 100644 settings.py delete mode 100644 settings_local.py.dist delete mode 100644 sql_scripts/cnprog.xml delete mode 100644 sql_scripts/cnprog_new_install.sql delete mode 100644 sql_scripts/cnprog_new_install_2009_02_28.sql delete mode 100644 sql_scripts/cnprog_new_install_2009_03_31.sql delete mode 100644 sql_scripts/cnprog_new_install_2009_04_07.sql delete mode 100644 sql_scripts/cnprog_new_install_2009_04_09.sql delete mode 100644 sql_scripts/update_2009_01_13_001.sql delete mode 100644 sql_scripts/update_2009_01_13_002.sql delete mode 100644 sql_scripts/update_2009_01_18_001.sql delete mode 100644 sql_scripts/update_2009_01_24.sql delete mode 100644 sql_scripts/update_2009_01_25_001.sql delete mode 100644 sql_scripts/update_2009_02_26_001.sql delete mode 100644 sql_scripts/update_2009_04_10_001.sql delete mode 100644 sql_scripts/update_2009_12_24_001.sql delete mode 100644 sql_scripts/update_2009_12_27_001.sql delete mode 100644 sql_scripts/update_2009_12_27_002.sql delete mode 100644 templates/404.html delete mode 100644 templates/500.html delete mode 100644 templates/about.html delete mode 100644 templates/allfiles delete mode 100644 templates/answer_edit.html delete mode 100644 templates/answer_edit_tips.html delete mode 100644 templates/ask.html delete mode 100644 templates/authopenid/changeemail.html delete mode 100644 templates/authopenid/changeopenid.html delete mode 100644 templates/authopenid/changepw.html delete mode 100644 templates/authopenid/complete.html delete mode 100644 templates/authopenid/confirm_email.txt delete mode 100644 templates/authopenid/delete.html delete mode 100644 templates/authopenid/failure.html delete mode 100644 templates/authopenid/htmlfiles delete mode 100644 templates/authopenid/sendpw.html delete mode 100644 templates/authopenid/sendpw_email.txt delete mode 100644 templates/authopenid/settings.html delete mode 100644 templates/authopenid/signin.html delete mode 100644 templates/authopenid/signup.html delete mode 100644 templates/authopenid/yadis.xrdf delete mode 100644 templates/badge.html delete mode 100644 templates/badges.html delete mode 100644 templates/base.html delete mode 100644 templates/base_content.html delete mode 100644 templates/book.html delete mode 100644 templates/close.html delete mode 100644 templates/content/images/box-arrow.gif delete mode 100644 templates/content/images/bullet_green.gif delete mode 100644 templates/content/images/cc-88x31.png delete mode 100644 templates/content/images/cc-wiki.png delete mode 100644 templates/content/images/close-small-hover.png delete mode 100644 templates/content/images/close-small.png delete mode 100644 templates/content/images/cnprog_logo_200_56.gif delete mode 100644 templates/content/images/dash.gif delete mode 100644 templates/content/images/djangomade124x25_grey.gif delete mode 100644 templates/content/images/dot-g.gif delete mode 100644 templates/content/images/dot-list.gif delete mode 100644 templates/content/images/edit.png delete mode 100644 templates/content/images/expander-arrow-hide.gif delete mode 100644 templates/content/images/expander-arrow-show.gif delete mode 100644 templates/content/images/favicon.gif delete mode 100644 templates/content/images/favicon.ico delete mode 100644 templates/content/images/feed-icon-small.png delete mode 100644 templates/content/images/grippie.png delete mode 100644 templates/content/images/indicator.gif delete mode 100644 templates/content/images/logo.png delete mode 100644 templates/content/images/logo1.png delete mode 100644 templates/content/images/logo2.png delete mode 100644 templates/content/images/medala.gif delete mode 100644 templates/content/images/medala_on.gif delete mode 100644 templates/content/images/new.gif delete mode 100644 templates/content/images/nophoto.png delete mode 100644 templates/content/images/openid.gif delete mode 100644 templates/content/images/openid/aol.gif delete mode 100644 templates/content/images/openid/blogger.ico delete mode 100644 templates/content/images/openid/claimid.ico delete mode 100644 templates/content/images/openid/facebook.gif delete mode 100644 templates/content/images/openid/flickr.ico delete mode 100644 templates/content/images/openid/google.gif delete mode 100644 templates/content/images/openid/livejournal.ico delete mode 100644 templates/content/images/openid/myopenid.ico delete mode 100644 templates/content/images/openid/openid-inputicon.gif delete mode 100644 templates/content/images/openid/openid.gif delete mode 100644 templates/content/images/openid/technorati.ico delete mode 100644 templates/content/images/openid/verisign.ico delete mode 100644 templates/content/images/openid/vidoop.ico delete mode 100644 templates/content/images/openid/wordpress.ico delete mode 100644 templates/content/images/openid/yahoo.gif delete mode 100644 templates/content/images/quest-bg.gif delete mode 100644 templates/content/images/vote-accepted-on.png delete mode 100644 templates/content/images/vote-accepted.png delete mode 100644 templates/content/images/vote-arrow-down-on.png delete mode 100644 templates/content/images/vote-arrow-down.png delete mode 100644 templates/content/images/vote-arrow-up-on.png delete mode 100644 templates/content/images/vote-arrow-up.png delete mode 100644 templates/content/images/vote-favorite-off.png delete mode 100644 templates/content/images/vote-favorite-on.png delete mode 100644 templates/content/js/com.cnprog.editor.js delete mode 100644 templates/content/js/com.cnprog.i18n.js delete mode 100644 templates/content/js/com.cnprog.post.js delete mode 100644 templates/content/js/com.cnprog.post.pack.js delete mode 100644 templates/content/js/com.cnprog.utils.js delete mode 100644 templates/content/js/compress.bat delete mode 100644 templates/content/js/excanvas.pack.js delete mode 100644 templates/content/js/flot-build.bat delete mode 100644 templates/content/js/jquery-1.2.6.js delete mode 100644 templates/content/js/jquery-1.2.6.min.js delete mode 100644 templates/content/js/jquery.ajaxfileupload.js delete mode 100644 templates/content/js/jquery.flot.js delete mode 100644 templates/content/js/jquery.flot.pack.js delete mode 100644 templates/content/js/jquery.i18n.js delete mode 100644 templates/content/js/jquery.openid.js delete mode 100644 templates/content/js/jquery.validate.pack.js delete mode 100644 templates/content/js/se_hilite.js delete mode 100644 templates/content/js/se_hilite_src.js delete mode 100644 templates/content/js/wmd/images/wmd-buttons.png delete mode 100644 templates/content/js/wmd/showdown-min.js delete mode 100644 templates/content/js/wmd/showdown.js delete mode 100644 templates/content/js/wmd/wmd-min.js delete mode 100644 templates/content/js/wmd/wmd-test.html delete mode 100644 templates/content/js/wmd/wmd.css delete mode 100644 templates/content/js/wmd/wmd.js delete mode 100644 templates/content/js/yuicompressor-2.4.2.jar delete mode 100644 templates/content/style/default.css delete mode 100644 templates/content/style/jquery.autocomplete.css delete mode 100644 templates/content/style/openid.css delete mode 100644 templates/content/style/prettify.css delete mode 100644 templates/content/style/style.css delete mode 100644 templates/faq.html delete mode 100644 templates/feeds/rss_description.html delete mode 100644 templates/feeds/rss_title.html delete mode 100644 templates/footer.html delete mode 100644 templates/header.html delete mode 100644 templates/index.html delete mode 100644 templates/logout.html delete mode 100644 templates/okfiles delete mode 100644 templates/pagesize.html delete mode 100644 templates/paginator.html delete mode 100644 templates/privacy.html delete mode 100644 templates/question.html delete mode 100644 templates/question_edit.html delete mode 100644 templates/question_edit_tips.html delete mode 100644 templates/question_retag.html delete mode 100644 templates/questions.html delete mode 100644 templates/reopen.html delete mode 100644 templates/revisions_answer.html delete mode 100644 templates/revisions_question.html delete mode 100644 templates/tags.html delete mode 100644 templates/template.list delete mode 100644 templates/tough/faq.html delete mode 100644 templates/tough/question_retag.html delete mode 100644 templates/tough/unanswered.html delete mode 100644 templates/unanswered.html delete mode 100755 templates/upfiles/1245715031297631.png delete mode 100755 templates/upfiles/12457157052552259.png delete mode 100644 templates/user.html delete mode 100644 templates/user_edit.html delete mode 100644 templates/user_favorites.html delete mode 100644 templates/user_footer.html delete mode 100644 templates/user_info.html delete mode 100644 templates/user_preferences.html delete mode 100644 templates/user_recent.html delete mode 100644 templates/user_reputation.html delete mode 100644 templates/user_responses.html delete mode 100644 templates/user_stats.html delete mode 100644 templates/user_tabs.html delete mode 100644 templates/user_votes.html delete mode 100644 templates/users.html delete mode 100644 templates/users_questions.html delete mode 100644 urls.py delete mode 100644 utils/__init__.py delete mode 100644 utils/cache.py delete mode 100644 utils/html.py delete mode 100644 utils/lists.py diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 3e82e786..00000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -settings_local.py -*.pyc -*.swp diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 59f2dd0b..00000000 --- a/INSTALL +++ /dev/null @@ -1,33 +0,0 @@ -PRE-REQUIREMENTS: ------------------------------------------------ -1. Python2.5, MySQL, Django v1.0+ - -2. Python-openid v2.2 -http://openidenabled.com/python-openid/ - -3. django-authopenid(Included in project already) -http://code.google.com/p/django-authopenid/ - -4. html5lib -http://code.google.com/p/html5lib/ -Used for HTML sanitizer - -5. Markdown2 -http://code.google.com/p/python-markdown2/ - - -INSTALL STEPS: ------------------------------------------------ -1. Copy settings_local.py.dist to settings_local.py and -update all your settings. Check settings.py and update -it as well if necessory. - -2. Prepare your database by using the same database/account -configuration from above. - -3. Run "python manager.py runserver" to startup django -development environment. - -4. There are some demo scripts under sql_scripts folder, -including badges and test accounts for CNProg.com. You -don't need them to run your sample. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index e23e4b67..00000000 --- a/LICENSE +++ /dev/null @@ -1,12 +0,0 @@ -版权所有(c) 2008 CNProg.com - -根据2.0版本Apache许可证("许可证")授权; -根据本许可证,用户可以不使用此文件。 -用户可从下列网址获得许可证副本: - -http://www.apache.org/licenses/LICENSE-2.0 - -除非因适用法律需要或书面同意, -根据许可证分发的软件是基于"按原样"基础提供, -无任何明示的或暗示的保证或条件。 -详见根据许可证许可下,特定语言的管辖权限和限制。 \ No newline at end of file diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/cnprog.wsgi b/cnprog.wsgi deleted file mode 100644 index a1bd8039..00000000 --- a/cnprog.wsgi +++ /dev/null @@ -1,8 +0,0 @@ -import os -import sys - -sys.path.append('/var/www/vhosts') -os.environ['DJANGO_SETTINGS_MODULE'] = 'cnprog.settings' - -import django.core.handlers.wsgi -application = django.core.handlers.wsgi.WSGIHandler() diff --git a/context.py b/context.py deleted file mode 100644 index f420b154..00000000 --- a/context.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.conf import settings -def application_settings(context): - return { - 'APP_TITLE' : settings.APP_TITLE, - 'APP_URL' : settings.APP_URL, - 'APP_KEYWORDS' : settings.APP_KEYWORDS, - 'APP_DESCRIPTION' : settings.APP_DESCRIPTION, - 'APP_INTRO' : settings.APP_INTRO - } diff --git a/development.log b/development.log deleted file mode 100644 index d8ca27c2..00000000 --- a/development.log +++ /dev/null @@ -1 +0,0 @@ -# development log \ No newline at end of file diff --git a/django_authopenid/__init__.py b/django_authopenid/__init__.py deleted file mode 100644 index ff040ed7..00000000 --- a/django_authopenid/__init__.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2007, 2008, Beno卯t Chesneau -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# * notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# * notice, this list of conditions and the following disclaimer in the -# * documentation and/or other materials provided with the -# * distribution. Neither the name of the nor the names -# * of its contributors may be used to endorse or promote products -# * derived from this software without specific prior written -# * permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -""" -Django authentification application to *with openid using django auth contrib/. - -This application allow a user to connect to you website with : - * legacy account : username/password - * openid url -""" - -__version__ = "0.9.4" diff --git a/django_authopenid/admin.py b/django_authopenid/admin.py deleted file mode 100644 index f64ee579..00000000 --- a/django_authopenid/admin.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- - -from django.contrib import admin -from django_authopenid.models import UserAssociation - - -class UserAssociationAdmin(admin.ModelAdmin): - """User association admin class""" -admin.site.register(UserAssociation, UserAssociationAdmin) \ No newline at end of file diff --git a/django_authopenid/forms.py b/django_authopenid/forms.py deleted file mode 100644 index 09fa76b1..00000000 --- a/django_authopenid/forms.py +++ /dev/null @@ -1,435 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2007, 2008, Beno卯t Chesneau -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# * notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# * notice, this list of conditions and the following disclaimer in the -# * documentation and/or other materials provided with the -# * distribution. Neither the name of the nor the names -# * of its contributors may be used to endorse or promote products -# * derived from this software without specific prior written -# * permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -from django import forms -from django.contrib.auth.models import User -from django.contrib.auth import authenticate -from django.utils.translation import ugettext as _ -from django.conf import settings - -import re - - -# needed for some linux distributions like debian -try: - from openid.yadis import xri -except ImportError: - from yadis import xri - -from django_authopenid.util import clean_next - -__all__ = ['OpenidSigninForm', 'OpenidAuthForm', 'OpenidVerifyForm', - 'OpenidRegisterForm', 'RegistrationForm', 'ChangepwForm', - 'ChangeemailForm', 'EmailPasswordForm', 'DeleteForm', - 'ChangeOpenidForm', 'ChangeEmailForm', 'ChangepwForm'] - -class OpenidSigninForm(forms.Form): - """ signin form """ - openid_url = forms.CharField(max_length=255, widget=forms.widgets.TextInput(attrs={'class': 'openid-login-input', 'size':80})) - next = forms.CharField(max_length=255, widget=forms.HiddenInput(), required=False) - - def clean_openid_url(self): - """ test if openid is accepted """ - if 'openid_url' in self.cleaned_data: - openid_url = self.cleaned_data['openid_url'] - if xri.identifierScheme(openid_url) == 'XRI' and getattr( - settings, 'OPENID_DISALLOW_INAMES', False - ): - raise forms.ValidationError(_('i-names are not supported')) - return self.cleaned_data['openid_url'] - - def clean_next(self): - """ validate next """ - if 'next' in self.cleaned_data and self.cleaned_data['next'] != "": - self.cleaned_data['next'] = clean_next(self.cleaned_data['next']) - return self.cleaned_data['next'] - - -attrs_dict = { 'class': 'required login' } -username_re = re.compile(r'^\w+$') -RESERVED_NAMES = (u'fuck', u'shit', u'ass', u'sex', u'add', - u'edit', u'save', u'delete', u'manage', u'update', 'remove', 'new') - -class OpenidAuthForm(forms.Form): - """ legacy account signin form """ - next = forms.CharField(max_length=255, widget=forms.HiddenInput(), - required=False) - username = forms.CharField(max_length=30, - widget=forms.widgets.TextInput(attrs=attrs_dict)) - password = forms.CharField(max_length=128, - widget=forms.widgets.PasswordInput(attrs=attrs_dict)) - - def __init__(self, data=None, files=None, auto_id='id_%s', - prefix=None, initial=None): - super(OpenidAuthForm, self).__init__(data, files, auto_id, - prefix, initial) - self.user_cache = None - - def clean_username(self): - """ validate username and test if it exists.""" - if 'username' in self.cleaned_data and \ - 'openid_url' not in self.cleaned_data: - if not username_re.search(self.cleaned_data['username']): - raise forms.ValidationError(_("Usernames can only contain \ - letters, numbers and underscores")) - try: - user = User.objects.get( - username__exact = self.cleaned_data['username'] - ) - except User.DoesNotExist: - raise forms.ValidationError(_("This username does not exist \ - in our database. Please choose another.")) - except User.MultipleObjectsReturned: - raise forms.ValidationError(u'There is already more than one \ - account registered with that username. Please try \ - another.') - return self.cleaned_data['username'] - - def clean_password(self): - """" test if password is valid for this username """ - if 'username' in self.cleaned_data and \ - 'password' in self.cleaned_data: - self.user_cache = authenticate( - username=self.cleaned_data['username'], - password=self.cleaned_data['password'] - ) - if self.user_cache is None: - raise forms.ValidationError(_("Please enter a valid \ - username and password. Note that both fields are \ - case-sensitive.")) - elif self.user_cache.is_active == False: - raise forms.ValidationError(_("This account is inactive.")) - return self.cleaned_data['password'] - - def clean_next(self): - """ validate next url """ - if 'next' in self.cleaned_data and \ - self.cleaned_data['next'] != "": - self.cleaned_data['next'] = clean_next(self.cleaned_data['next']) - return self.cleaned_data['next'] - - def get_user(self): - """ get authenticated user """ - return self.user_cache - - -class OpenidRegisterForm(forms.Form): - """ openid signin form """ - next = forms.CharField(max_length=255, widget=forms.HiddenInput(), - required=False) - username = forms.CharField(max_length=30, - widget=forms.widgets.TextInput(attrs=attrs_dict)) - email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict, - maxlength=200)), label=u'Email address') - - def clean_username(self): - """ test if username is valid and exist in database """ - if 'username' in self.cleaned_data: - if not username_re.search(self.cleaned_data['username']): - raise forms.ValidationError(_('invalid user name')) - if self.cleaned_data['username'] in RESERVED_NAMES: - raise forms.ValidationError(_('sorry, this name can not be used, please try another')) - if len(self.cleaned_data['username']) < 3: - raise forms.ValidationError(_('username too short')) - try: - user = User.objects.get( - username__exact = self.cleaned_data['username'] - ) - except User.DoesNotExist: - return self.cleaned_data['username'] - except User.MultipleObjectsReturned: - raise forms.ValidationError(_('this name is already in use - please try anoter')) - raise forms.ValidationError(_('this name is already in use - please try anoter')) - - def clean_email(self): - """For security reason one unique email in database""" - if 'email' in self.cleaned_data: - try: - user = User.objects.get(email = self.cleaned_data['email']) - except User.DoesNotExist: - return self.cleaned_data['email'] - except User.MultipleObjectsReturned: - raise forms.ValidationError(u'There is already more than one \ - account registered with that e-mail address. Please try \ - another.') - raise forms.ValidationError(_("This email is already \ - registered in our database. Please choose another.")) - - -class OpenidVerifyForm(forms.Form): - """ openid verify form (associate an openid with an account) """ - next = forms.CharField(max_length=255, widget = forms.HiddenInput(), - required=False) - username = forms.CharField(max_length=30, - widget=forms.widgets.TextInput(attrs=attrs_dict)) - password = forms.CharField(max_length=128, - widget=forms.widgets.PasswordInput(attrs=attrs_dict)) - - def __init__(self, data=None, files=None, auto_id='id_%s', - prefix=None, initial=None): - super(OpenidVerifyForm, self).__init__(data, files, auto_id, - prefix, initial) - self.user_cache = None - - def clean_username(self): - """ validate username """ - if 'username' in self.cleaned_data: - if not username_re.search(self.cleaned_data['username']): - raise forms.ValidationError(_("Usernames can only contain \ - letters, numbers and underscores")) - try: - user = User.objects.get( - username__exact = self.cleaned_data['username'] - ) - except User.DoesNotExist: - raise forms.ValidationError(_("This username don't exist. \ - Please choose another.")) - except User.MultipleObjectsReturned: - raise forms.ValidationError(u'Somehow, that username is in \ - use for multiple accounts. Please contact us to get this \ - problem resolved.') - return self.cleaned_data['username'] - - def clean_password(self): - """ test if password is valid for this user """ - if 'username' in self.cleaned_data and \ - 'password' in self.cleaned_data: - self.user_cache = authenticate( - username = self.cleaned_data['username'], - password = self.cleaned_data['password'] - ) - if self.user_cache is None: - raise forms.ValidationError(_("Please enter a valid \ - username and password. Note that both fields are \ - case-sensitive.")) - elif self.user_cache.is_active == False: - raise forms.ValidationError(_("This account is inactive.")) - return self.cleaned_data['password'] - - def get_user(self): - """ get authenticated user """ - return self.user_cache - - -attrs_dict = { 'class': 'required' } -username_re = re.compile(r'^\w+$') - -class RegistrationForm(forms.Form): - """ legacy registration form """ - - next = forms.CharField(max_length=255, widget=forms.HiddenInput(), - required=False) - username = forms.CharField(max_length=30, - widget=forms.TextInput(attrs=attrs_dict), - label=_('choose a username')) - email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict, - maxlength=200)), label=_('your email address')) - password1 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict), - label=_('choose password')) - password2 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict), - label=_('retype password')) - - def clean_username(self): - """ - Validates that the username is alphanumeric and is not already - in use. - - """ - if 'username' in self.cleaned_data: - if not username_re.search(self.cleaned_data['username']): - raise forms.ValidationError(u'Usernames can only contain \ - letters, numbers and underscores') - try: - user = User.objects.get( - username__exact = self.cleaned_data['username'] - ) - - except User.DoesNotExist: - return self.cleaned_data['username'] - except User.MultipleObjectsReturned: - raise forms.ValidationError(u'Somehow, that username is in \ - use for multiple accounts. Please contact us to get this \ - problem resolved.') - raise forms.ValidationError(u'This username is already taken. \ - Please choose another.') - - def clean_email(self): - """ validate if email exist in database - :return: raise error if it exist """ - if 'email' in self.cleaned_data: - try: - user = User.objects.get(email = self.cleaned_data['email']) - except User.DoesNotExist: - return self.cleaned_data['email'] - except User.MultipleObjectsReturned: - raise forms.ValidationError(u'There is already more than one \ - account registered with that e-mail address. Please try \ - another.') - raise forms.ValidationError(u'This email is already registered \ - in our database. Please choose another.') - return self.cleaned_data['email'] - - def clean_password2(self): - """ - Validates that the two password inputs match. - - """ - if 'password1' in self.cleaned_data and \ - 'password2' in self.cleaned_data and \ - self.cleaned_data['password1'] == \ - self.cleaned_data['password2']: - return self.cleaned_data['password2'] - raise forms.ValidationError(u'You must type the same password each \ - time') - - -class ChangepwForm(forms.Form): - """ change password form """ - oldpw = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict)) - password1 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict)) - password2 = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict)) - - def __init__(self, data=None, user=None, *args, **kwargs): - if user is None: - raise TypeError("Keyword argument 'user' must be supplied") - super(ChangepwForm, self).__init__(data, *args, **kwargs) - self.user = user - - def clean_oldpw(self): - """ test old password """ - if not self.user.check_password(self.cleaned_data['oldpw']): - raise forms.ValidationError(_("Old password is incorrect. \ - Please enter the correct password.")) - return self.cleaned_data['oldpw'] - - def clean_password2(self): - """ - Validates that the two password inputs match. - """ - if 'password1' in self.cleaned_data and \ - 'password2' in self.cleaned_data and \ - self.cleaned_data['password1'] == self.cleaned_data['password2']: - return self.cleaned_data['password2'] - raise forms.ValidationError(_("new passwords do not match")) - - -class ChangeemailForm(forms.Form): - """ change email form """ - email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict, - maxlength=200)), label=u'Email address') - password = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict)) - - def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, \ - initial=None, user=None): - if user is None: - raise TypeError("Keyword argument 'user' must be supplied") - super(ChangeemailForm, self).__init__(data, files, auto_id, - prefix, initial) - self.test_openid = False - self.user = user - - - def clean_email(self): - """ check if email don't exist """ - if 'email' in self.cleaned_data: - if self.user.email != self.cleaned_data['email']: - try: - user = User.objects.get(email = self.cleaned_data['email']) - except User.DoesNotExist: - return self.cleaned_data['email'] - except User.MultipleObjectsReturned: - raise forms.ValidationError(u'There is already more than one \ - account registered with that e-mail address. Please try \ - another.') - raise forms.ValidationError(u'This email is already registered \ - in our database. Please choose another.') - return self.cleaned_data['email'] - - - def clean_password(self): - """ check if we have to test a legacy account or not """ - if 'password' in self.cleaned_data: - if not self.user.check_password(self.cleaned_data['password']): - self.test_openid = True - return self.cleaned_data['password'] - -class ChangeopenidForm(forms.Form): - """ change openid form """ - openid_url = forms.CharField(max_length=255, - widget=forms.TextInput(attrs={'class': "required" })) - - def __init__(self, data=None, user=None, *args, **kwargs): - if user is None: - raise TypeError("Keyword argument 'user' must be supplied") - super(ChangeopenidForm, self).__init__(data, *args, **kwargs) - self.user = user - -class DeleteForm(forms.Form): - """ confirm form to delete an account """ - confirm = forms.CharField(widget=forms.CheckboxInput(attrs=attrs_dict)) - password = forms.CharField(widget=forms.PasswordInput(attrs=attrs_dict)) - - def __init__(self, data=None, files=None, auto_id='id_%s', - prefix=None, initial=None, user=None): - super(DeleteForm, self).__init__(data, files, auto_id, prefix, initial) - self.test_openid = False - self.user = user - - def clean_password(self): - """ check if we have to test a legacy account or not """ - if 'password' in self.cleaned_data: - if not self.user.check_password(self.cleaned_data['password']): - self.test_openid = True - return self.cleaned_data['password'] - - -class EmailPasswordForm(forms.Form): - """ send new password form """ - username = forms.CharField(max_length=30, - widget=forms.TextInput(attrs={'class': "required" })) - - def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, - initial=None): - super(EmailPasswordForm, self).__init__(data, files, auto_id, - prefix, initial) - self.user_cache = None - - - def clean_username(self): - """ get user for this username """ - if 'username' in self.cleaned_data: - try: - self.user_cache = User.objects.get( - username = self.cleaned_data['username']) - except: - raise forms.ValidationError(_("Incorrect username.")) - return self.cleaned_data['username'] diff --git a/django_authopenid/middleware.py b/django_authopenid/middleware.py deleted file mode 100644 index c0572c6e..00000000 --- a/django_authopenid/middleware.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from django_authopenid import mimeparse -from django.http import HttpResponseRedirect -from django.core.urlresolvers import reverse - -__all__ = ["OpenIDMiddleware"] - -class OpenIDMiddleware(object): - """ - Populate request.openid. This comes either from cookie or from - session, depending on the presence of OPENID_USE_SESSIONS. - """ - def process_request(self, request): - request.openid = request.session.get('openid', None) - - def process_response(self, request, response): - if response.status_code != 200 or len(response.content) < 200: - return response - path = request.get_full_path() - if path == "/" and request.META.has_key('HTTP_ACCEPT') and \ - mimeparse.best_match(['text/html', 'application/xrds+xml'], - request.META['HTTP_ACCEPT']) == 'application/xrds+xml': - return HttpResponseRedirect(reverse('yadis_xrdf')) - return response \ No newline at end of file diff --git a/django_authopenid/mimeparse.py b/django_authopenid/mimeparse.py deleted file mode 100644 index ab02eab0..00000000 --- a/django_authopenid/mimeparse.py +++ /dev/null @@ -1,160 +0,0 @@ -"""MIME-Type Parser - -This module provides basic functions for handling mime-types. It can handle -matching mime-types against a list of media-ranges. See section 14.1 of -the HTTP specification [RFC 2616] for a complete explaination. - - http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 - -Contents: - - parse_mime_type(): Parses a mime-type into it's component parts. - - parse_media_range(): Media-ranges are mime-types with wild-cards and a 'q' quality parameter. - - quality(): Determines the quality ('q') of a mime-type when compared against a list of media-ranges. - - quality_parsed(): Just like quality() except the second parameter must be pre-parsed. - - best_match(): Choose the mime-type with the highest quality ('q') from a list of candidates. -""" - -__version__ = "0.1.1" -__author__ = 'Joe Gregorio' -__email__ = "joe@bitworking.org" -__credits__ = "" - -def parse_mime_type(mime_type): - """Carves up a mime_type and returns a tuple of the - (type, subtype, params) where 'params' is a dictionary - of all the parameters for the media range. - For example, the media range 'application/xhtml;q=0.5' would - get parsed into: - - ('application', 'xhtml', {'q', '0.5'}) - """ - parts = mime_type.split(";") - params = dict([tuple([s.strip() for s in param.split("=")])\ - for param in parts[1:] ]) - (type, subtype) = parts[0].split("/") - return (type.strip(), subtype.strip(), params) - -def parse_media_range(range): - """Carves up a media range and returns a tuple of the - (type, subtype, params) where 'params' is a dictionary - of all the parameters for the media range. - For example, the media range 'application/*;q=0.5' would - get parsed into: - - ('application', '*', {'q', '0.5'}) - - In addition this function also guarantees that there - is a value for 'q' in the params dictionary, filling it - in with a proper default if necessary. - """ - (type, subtype, params) = parse_mime_type(range) - if not params.has_key('q') or not params['q'] or \ - not float(params['q']) or float(params['q']) > 1\ - or float(params['q']) < 0: - params['q'] = '1' - return (type, subtype, params) - -def quality_parsed(mime_type, parsed_ranges): - """Find the best match for a given mime_type against - a list of media_ranges that have already been - parsed by parse_media_range(). Returns the - 'q' quality parameter of the best match, 0 if no - match was found. This function bahaves the same as quality() - except that 'parsed_ranges' must be a list of - parsed media ranges. """ - best_fitness = -1 - best_match = "" - best_fit_q = 0 - (target_type, target_subtype, target_params) =\ - parse_media_range(mime_type) - for (type, subtype, params) in parsed_ranges: - param_matches = reduce(lambda x, y: x+y, [1 for (key, value) in \ - target_params.iteritems() if key != 'q' and \ - params.has_key(key) and value == params[key]], 0) - if (type == target_type or type == '*' or target_type == '*') and \ - (subtype == target_subtype or subtype == '*' or target_subtype == '*'): - fitness = (type == target_type) and 100 or 0 - fitness += (subtype == target_subtype) and 10 or 0 - fitness += param_matches - if fitness > best_fitness: - best_fitness = fitness - best_fit_q = params['q'] - - return float(best_fit_q) - -def quality(mime_type, ranges): - """Returns the quality 'q' of a mime_type when compared - against the media-ranges in ranges. For example: - - >>> quality('text/html','text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5') - 0.7 - - """ - parsed_ranges = [parse_media_range(r) for r in ranges.split(",")] - return quality_parsed(mime_type, parsed_ranges) - -def best_match(supported, header): - """Takes a list of supported mime-types and finds the best - match for all the media-ranges listed in header. The value of - header must be a string that conforms to the format of the - HTTP Accept: header. The value of 'supported' is a list of - mime-types. - - >>> best_match(['application/xbel+xml', 'text/xml'], 'text/*;q=0.5,*/*; q=0.1') - 'text/xml' - """ - parsed_header = [parse_media_range(r) for r in header.split(",")] - weighted_matches = [(quality_parsed(mime_type, parsed_header), mime_type)\ - for mime_type in supported] - weighted_matches.sort() - return weighted_matches[-1][0] and weighted_matches[-1][1] or '' - -if __name__ == "__main__": - import unittest - - class TestMimeParsing(unittest.TestCase): - - def test_parse_media_range(self): - self.assert_(('application', 'xml', {'q': '1'}) == parse_media_range('application/xml;q=1')) - self.assertEqual(('application', 'xml', {'q': '1'}), parse_media_range('application/xml')) - self.assertEqual(('application', 'xml', {'q': '1'}), parse_media_range('application/xml;q=')) - self.assertEqual(('application', 'xml', {'q': '1'}), parse_media_range('application/xml ; q=')) - self.assertEqual(('application', 'xml', {'q': '1', 'b': 'other'}), parse_media_range('application/xml ; q=1;b=other')) - self.assertEqual(('application', 'xml', {'q': '1', 'b': 'other'}), parse_media_range('application/xml ; q=2;b=other')) - - def test_rfc_2616_example(self): - accept = "text/*;q=0.3, text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4, */*;q=0.5" - self.assertEqual(1, quality("text/html;level=1", accept)) - self.assertEqual(0.7, quality("text/html", accept)) - self.assertEqual(0.3, quality("text/plain", accept)) - self.assertEqual(0.5, quality("image/jpeg", accept)) - self.assertEqual(0.4, quality("text/html;level=2", accept)) - self.assertEqual(0.7, quality("text/html;level=3", accept)) - - def test_best_match(self): - mime_types_supported = ['application/xbel+xml', 'application/xml'] - # direct match - self.assertEqual(best_match(mime_types_supported, 'application/xbel+xml'), 'application/xbel+xml') - # direct match with a q parameter - self.assertEqual(best_match(mime_types_supported, 'application/xbel+xml; q=1'), 'application/xbel+xml') - # direct match of our second choice with a q parameter - self.assertEqual(best_match(mime_types_supported, 'application/xml; q=1'), 'application/xml') - # match using a subtype wildcard - self.assertEqual(best_match(mime_types_supported, 'application/*; q=1'), 'application/xml') - # match using a type wildcard - self.assertEqual(best_match(mime_types_supported, '*/*'), 'application/xml') - - mime_types_supported = ['application/xbel+xml', 'text/xml'] - # match using a type versus a lower weighted subtype - self.assertEqual(best_match(mime_types_supported, 'text/*;q=0.5,*/*; q=0.1'), 'text/xml') - # fail to match anything - self.assertEqual(best_match(mime_types_supported, 'text/html,application/atom+xml; q=0.9'), '') - - def test_support_wildcards(self): - mime_types_supported = ['image/*', 'application/xml'] - # match using a type wildcard - self.assertEqual(best_match(mime_types_supported, 'image/png'), 'image/*') - # match using a wildcard for both requested and supported - self.assertEqual(best_match(mime_types_supported, 'image/*'), 'image/*') - - unittest.main() \ No newline at end of file diff --git a/django_authopenid/models.py b/django_authopenid/models.py deleted file mode 100644 index 9826c452..00000000 --- a/django_authopenid/models.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -from django.conf import settings -from django.contrib.auth.models import User -from django.db import models - -import md5, random, sys, os, time - -__all__ = ['Nonce', 'Association', 'UserAssociation', - 'UserPasswordQueueManager', 'UserPasswordQueue'] - -class Nonce(models.Model): - """ openid nonce """ - server_url = models.CharField(max_length=255) - timestamp = models.IntegerField() - salt = models.CharField(max_length=40) - - def __unicode__(self): - return u"Nonce: %s" % self.id - - -class Association(models.Model): - """ association openid url and lifetime """ - server_url = models.TextField(max_length=2047) - handle = models.CharField(max_length=255) - secret = models.TextField(max_length=255) # Stored base64 encoded - issued = models.IntegerField() - lifetime = models.IntegerField() - assoc_type = models.TextField(max_length=64) - - def __unicode__(self): - return u"Association: %s, %s" % (self.server_url, self.handle) - -class UserAssociation(models.Model): - """ - model to manage association between openid and user - """ - openid_url = models.CharField(blank=False, max_length=255) - user = models.ForeignKey(User, unique=True) - - def __unicode__(self): - return "Openid %s with user %s" % (self.openid_url, self.user) - -class UserPasswordQueueManager(models.Manager): - """ manager for UserPasswordQueue object """ - def get_new_confirm_key(self): - "Returns key that isn't being used." - # The random module is seeded when this Apache child is created. - # Use SECRET_KEY as added salt. - while 1: - confirm_key = md5.new("%s%s%s%s" % ( - random.randint(0, sys.maxint - 1), os.getpid(), - time.time(), settings.SECRET_KEY)).hexdigest() - try: - self.get(confirm_key=confirm_key) - except self.model.DoesNotExist: - break - return confirm_key - - -class UserPasswordQueue(models.Model): - """ - model for new password queue. - """ - user = models.ForeignKey(User, unique=True) - new_password = models.CharField(max_length=30) - confirm_key = models.CharField(max_length=40) - - objects = UserPasswordQueueManager() - - def __unicode__(self): - return self.user.username diff --git a/django_authopenid/urls.py b/django_authopenid/urls.py deleted file mode 100644 index 1ab65941..00000000 --- a/django_authopenid/urls.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- -from django.conf.urls.defaults import patterns, url -from django.utils.translation import ugettext as _ - -urlpatterns = patterns('django_authopenid.views', - # yadis rdf - url(r'^yadis.xrdf$', 'xrdf', name='yadis_xrdf'), - # manage account registration - url(r'^%s$' % _('signin/'), 'signin', name='user_signin'), - url(r'^%s$' % _('signout/'), 'signout', name='user_signout'), - url(r'^%s%s$' % (_('signin/'), _('complete/')), 'complete_signin', - name='user_complete_signin'), - url(r'^%s$' % _('register/'), 'register', name='user_register'), - url(r'^%s$' % _('signup/'), 'signup', name='user_signup'), - #disable current sendpw function - url(r'^%s$' % _('sendpw/'), 'signin', name='user_sendpw'), - #url(r'^%s$' % _('sendpw/'), 'sendpw', name='user_sendpw'), - #url(r'^%s%s$' % (_('password/'), _('confirm/')), 'confirmchangepw', - # name='user_confirmchangepw'), - - # manage account settings - #url(r'^$', 'account_settings', name='user_account_settings'), - #url(r'^%s$' % _('password/'), 'changepw', name='user_changepw'), - #url(r'^%s$' % _('email/'), 'changeemail', name='user_changeemail'), - #url(r'^%s$' % _('openid/'), 'changeopenid', name='user_changeopenid'), - url(r'^%s$' % _('delete/'), 'delete', name='user_delete'), -) diff --git a/django_authopenid/util.py b/django_authopenid/util.py deleted file mode 100644 index 841a81c7..00000000 --- a/django_authopenid/util.py +++ /dev/null @@ -1,145 +0,0 @@ -# -*- coding: utf-8 -*- -from openid.store.interface import OpenIDStore -from openid.association import Association as OIDAssociation -from openid.extensions import sreg -import openid.store - -from django.db.models.query import Q -from django.conf import settings -from django.http import str_to_unicode - - -# needed for some linux distributions like debian -try: - from openid.yadis import xri -except: - from yadis import xri - -import time, base64, md5, operator -import urllib - -from models import Association, Nonce - -__all__ = ['OpenID', 'DjangoOpenIDStore', 'from_openid_response', 'clean_next'] - -DEFAULT_NEXT = getattr(settings, 'OPENID_REDIRECT_NEXT', '/') -def clean_next(next): - if next is None: - return DEFAULT_NEXT - next = str_to_unicode(urllib.unquote(next), 'utf-8') - next = next.strip() - if next.startswith('/'): - return next - return DEFAULT_NEXT - -class OpenID: - def __init__(self, openid_, issued, attrs=None, sreg_=None): - self.openid = openid_ - self.issued = issued - self.attrs = attrs or {} - self.sreg = sreg_ or {} - self.is_iname = (xri.identifierScheme(openid_) == 'XRI') - - def __repr__(self): - return '' % self.openid - - def __str__(self): - return self.openid - -class DjangoOpenIDStore(OpenIDStore): - def __init__(self): - self.max_nonce_age = 6 * 60 * 60 # Six hours - - def storeAssociation(self, server_url, association): - assoc = Association( - server_url = server_url, - handle = association.handle, - secret = base64.encodestring(association.secret), - issued = association.issued, - lifetime = association.issued, - assoc_type = association.assoc_type - ) - assoc.save() - - def getAssociation(self, server_url, handle=None): - assocs = [] - if handle is not None: - assocs = Association.objects.filter( - server_url = server_url, handle = handle - ) - else: - assocs = Association.objects.filter( - server_url = server_url - ) - if not assocs: - return None - associations = [] - for assoc in assocs: - association = OIDAssociation( - assoc.handle, base64.decodestring(assoc.secret), assoc.issued, - assoc.lifetime, assoc.assoc_type - ) - if association.getExpiresIn() == 0: - self.removeAssociation(server_url, assoc.handle) - else: - associations.append((association.issued, association)) - if not associations: - return None - return associations[-1][1] - - def removeAssociation(self, server_url, handle): - assocs = list(Association.objects.filter( - server_url = server_url, handle = handle - )) - assocs_exist = len(assocs) > 0 - for assoc in assocs: - assoc.delete() - return assocs_exist - - def useNonce(self, server_url, timestamp, salt): - if abs(timestamp - time.time()) > openid.store.nonce.SKEW: - return False - - query = [ - Q(server_url__exact=server_url), - Q(timestamp__exact=timestamp), - Q(salt__exact=salt), - ] - try: - ononce = Nonce.objects.get(reduce(operator.and_, query)) - except Nonce.DoesNotExist: - ononce = Nonce( - server_url=server_url, - timestamp=timestamp, - salt=salt - ) - ononce.save() - return True - - ononce.delete() - - return False - - def cleanupNonce(self): - Nonce.objects.filter(timestamp nor the names -# * of its contributors may be used to endorse or promote products -# * derived from this software without specific prior written -# * permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, -# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -from django.http import HttpResponseRedirect, get_host -from django.shortcuts import render_to_response as render -from django.template import RequestContext, loader, Context -from django.conf import settings -from django.contrib.auth.models import User -from django.contrib.auth import login, logout -from django.contrib.auth.decorators import login_required -from django.core.urlresolvers import reverse -from django.utils.encoding import smart_unicode -from django.utils.html import escape -from django.utils.translation import ugettext as _ -from django.contrib.sites.models import Site -from django.utils.http import urlquote_plus -from django.core.mail import send_mail - -from openid.consumer.consumer import Consumer, \ - SUCCESS, CANCEL, FAILURE, SETUP_NEEDED -from openid.consumer.discover import DiscoveryFailure -from openid.extensions import sreg -# needed for some linux distributions like debian -try: - from openid.yadis import xri -except ImportError: - from yadis import xri - -import re -import urllib - - -from django_authopenid.util import OpenID, DjangoOpenIDStore, from_openid_response, clean_next -from django_authopenid.models import UserAssociation, UserPasswordQueue -from django_authopenid.forms import OpenidSigninForm, OpenidAuthForm, OpenidRegisterForm, \ - OpenidVerifyForm, RegistrationForm, ChangepwForm, ChangeemailForm, \ - ChangeopenidForm, DeleteForm, EmailPasswordForm - -def get_url_host(request): - if request.is_secure(): - protocol = 'https' - else: - protocol = 'http' - host = escape(get_host(request)) - return '%s://%s' % (protocol, host) - -def get_full_url(request): - return get_url_host(request) + request.get_full_path() - - - -def ask_openid(request, openid_url, redirect_to, on_failure=None, - sreg_request=None): - """ basic function to ask openid and return response """ - request.encoding = 'UTF-8' - on_failure = on_failure or signin_failure - - trust_root = getattr( - settings, 'OPENID_TRUST_ROOT', get_url_host(request) + '/' - ) - if xri.identifierScheme(openid_url) == 'XRI' and getattr( - settings, 'OPENID_DISALLOW_INAMES', False - ): - msg = _("i-names are not supported") - return on_failure(request, msg) - consumer = Consumer(request.session, DjangoOpenIDStore()) - try: - auth_request = consumer.begin(openid_url) - except DiscoveryFailure: - msg = _(u"闈炴硶OpenID鍦板潃锛 %s" % openid_url) - return on_failure(request, msg) - - if sreg_request: - auth_request.addExtension(sreg_request) - redirect_url = auth_request.redirectURL(trust_root, redirect_to) - return HttpResponseRedirect(redirect_url) - -def complete(request, on_success=None, on_failure=None, return_to=None): - """ complete openid signin """ - on_success = on_success or default_on_success - on_failure = on_failure or default_on_failure - - consumer = Consumer(request.session, DjangoOpenIDStore()) - # make sure params are encoded in utf8 - params = dict((k,smart_unicode(v)) for k, v in request.GET.items()) - openid_response = consumer.complete(params, return_to) - - - if openid_response.status == SUCCESS: - return on_success(request, openid_response.identity_url, - openid_response) - elif openid_response.status == CANCEL: - return on_failure(request, 'The request was canceled') - elif openid_response.status == FAILURE: - return on_failure(request, openid_response.message) - elif openid_response.status == SETUP_NEEDED: - return on_failure(request, 'Setup needed') - else: - assert False, "Bad openid status: %s" % openid_response.status - -def default_on_success(request, identity_url, openid_response): - """ default action on openid signin success """ - request.session['openid'] = from_openid_response(openid_response) - return HttpResponseRedirect(clean_next(request.GET.get('next'))) - -def default_on_failure(request, message): - """ default failure action on signin """ - return render('openid_failure.html', { - 'message': message - }) - - -def not_authenticated(func): - """ decorator that redirect user to next page if - he is already logged.""" - def decorated(request, *args, **kwargs): - if request.user.is_authenticated(): - next = request.GET.get("next", "/") - return HttpResponseRedirect(next) - return func(request, *args, **kwargs) - return decorated - -@not_authenticated -def signin(request): - """ - signin page. It manage the legacy authentification (user/password) - and authentification with openid. - - url: /signin/ - - template : authopenid/signin.htm - """ - request.encoding = 'UTF-8' - on_failure = signin_failure - next = clean_next(request.GET.get('next')) - - form_signin = OpenidSigninForm(initial={'next':next}) - form_auth = OpenidAuthForm(initial={'next':next}) - - if request.POST: - - if 'bsignin' in request.POST.keys(): - - form_signin = OpenidSigninForm(request.POST) - if form_signin.is_valid(): - next = clean_next(form_signin.cleaned_data.get('next')) - sreg_req = sreg.SRegRequest(optional=['nickname', 'email']) - redirect_to = "%s%s?%s" % ( - get_url_host(request), - reverse('user_complete_signin'), - urllib.urlencode({'next':next}) - ) - - return ask_openid(request, - form_signin.cleaned_data['openid_url'], - redirect_to, - on_failure=signin_failure, - sreg_request=sreg_req) - - elif 'blogin' in request.POST.keys(): - # perform normal django authentification - form_auth = OpenidAuthForm(request.POST) - if form_auth.is_valid(): - user_ = form_auth.get_user() - login(request, user_) - next = clean_next(form_auth.cleaned_data.get('next')) - return HttpResponseRedirect(next) - - - return render('authopenid/signin.html', { - 'form1': form_auth, - 'form2': form_signin, - 'msg': request.GET.get('msg',''), - 'sendpw_url': reverse('user_sendpw'), - }, context_instance=RequestContext(request)) - -def complete_signin(request): - """ in case of complete signin with openid """ - return complete(request, signin_success, signin_failure, - get_url_host(request) + reverse('user_complete_signin')) - - -def signin_success(request, identity_url, openid_response): - """ - openid signin success. - - If the openid is already registered, the user is redirected to - url set par next or in settings with OPENID_REDIRECT_NEXT variable. - If none of these urls are set user is redirectd to /. - - if openid isn't registered user is redirected to register page. - """ - - openid_ = from_openid_response(openid_response) - request.session['openid'] = openid_ - try: - rel = UserAssociation.objects.get(openid_url__exact = str(openid_)) - except: - # try to register this new user - return register(request) - user_ = rel.user - if user_.is_active: - user_.backend = "django.contrib.auth.backends.ModelBackend" - login(request, user_) - - next = clean_next(request.GET.get('next')) - return HttpResponseRedirect(next) - -def is_association_exist(openid_url): - """ test if an openid is already in database """ - is_exist = True - try: - uassoc = UserAssociation.objects.get(openid_url__exact = openid_url) - except: - is_exist = False - return is_exist - -@not_authenticated -def register(request): - """ - register an openid. - - If user is already a member he can associate its openid with - its account. - - A new account could also be created and automaticaly associated - to the openid. - - url : /complete/ - - template : authopenid/complete.html - """ - - is_redirect = False - next = clean_next(request.GET.get('next')) - openid_ = request.session.get('openid', None) - if not openid_: - return HttpResponseRedirect(reverse('user_signin') + next) - - nickname = openid_.sreg.get('nickname', '') - email = openid_.sreg.get('email', '') - - form1 = OpenidRegisterForm(initial={ - 'next': next, - 'username': nickname, - 'email': email, - }) - form2 = OpenidVerifyForm(initial={ - 'next': next, - 'username': nickname, - }) - - if request.POST: - just_completed = False - if 'bnewaccount' in request.POST.keys(): - form1 = OpenidRegisterForm(request.POST) - if form1.is_valid(): - next = clean_next(form1.cleaned_data.get('next')) - is_redirect = True - tmp_pwd = User.objects.make_random_password() - user_ = User.objects.create_user(form1.cleaned_data['username'], - form1.cleaned_data['email'], tmp_pwd) - - # make association with openid - uassoc = UserAssociation(openid_url=str(openid_), - user_id=user_.id) - uassoc.save() - - # login - user_.backend = "django.contrib.auth.backends.ModelBackend" - login(request, user_) - elif 'bverify' in request.POST.keys(): - form2 = OpenidVerifyForm(request.POST) - if form2.is_valid(): - is_redirect = True - next = clean_next(form2.cleaned_data.get('next')) - user_ = form2.get_user() - - uassoc = UserAssociation(openid_url=str(openid_), - user_id=user_.id) - uassoc.save() - login(request, user_) - - # redirect, can redirect only if forms are valid. - if is_redirect: - return HttpResponseRedirect(next) - - return render('authopenid/complete.html', { - 'form1': form1, - 'form2': form2, - 'nickname': nickname, - 'email': email - }, context_instance=RequestContext(request)) - -def signin_failure(request, message): - """ - falure with openid signin. Go back to signin page. - - template : "authopenid/signin.html" - """ - next = clean_next(request.GET.get('next')) - form_signin = OpenidSigninForm(initial={'next': next}) - form_auth = OpenidAuthForm(initial={'next': next}) - - return render('authopenid/signin.html', { - 'msg': message, - 'form1': form_auth, - 'form2': form_signin, - }, context_instance=RequestContext(request)) - -@not_authenticated -def signup(request): - """ - signup page. Create a legacy account - - url : /signup/" - - templates: authopenid/signup.html, authopenid/confirm_email.txt - """ - action_signin = reverse('user_signin') - next = clean_next(request.GET.get('next')) - form = RegistrationForm(initial={'next':next}) - form_signin = OpenidSigninForm(initial={'next':next}) - - if request.POST: - form = RegistrationForm(request.POST) - if form.is_valid(): - next = clean_next(form.cleaned_data.get('next')) - user_ = User.objects.create_user( form.cleaned_data['username'], - form.cleaned_data['email'], form.cleaned_data['password1']) - - user_.backend = "django.contrib.auth.backends.ModelBackend" - login(request, user_) - - # send email - current_domain = Site.objects.get_current().domain - subject = _("Welcome") - message_template = loader.get_template( - 'authopenid/confirm_email.txt' - ) - message_context = Context({ - 'site_url': 'http://%s/' % current_domain, - 'username': form.cleaned_data['username'], - 'password': form.cleaned_data['password1'] - }) - message = message_template.render(message_context) - send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, - [user_.email]) - - return HttpResponseRedirect(next) - - return render('authopenid/signup.html', { - 'form': form, - 'form2': form_signin, - }, context_instance=RequestContext(request)) - -@login_required -def signout(request): - """ - signout from the website. Remove openid from session and kill it. - - url : /signout/" - """ - try: - del request.session['openid'] - except KeyError: - pass - next = clean_next(request.GET.get('next')) - logout(request) - - return HttpResponseRedirect(next) - -def xrdf(request): - url_host = get_url_host(request) - return_to = [ - "%s%s" % (url_host, reverse('user_complete_signin')) - ] - return render('authopenid/yadis.xrdf', { - 'return_to': return_to - }, context_instance=RequestContext(request)) - -@login_required -def account_settings(request): - """ - index pages to changes some basic account settings : - - change password - - change email - - associate a new openid - - delete account - - url : / - - template : authopenid/settings.html - """ - msg = request.GET.get('msg', '') - is_openid = True - - try: - uassoc = UserAssociation.objects.get( - user__username__exact=request.user.username - ) - except: - is_openid = False - - - return render('authopenid/settings.html', { - 'msg': msg, - 'is_openid': is_openid - }, context_instance=RequestContext(request)) - -@login_required -def changepw(request): - """ - change password view. - - url : /changepw/ - template: authopenid/changepw.html - """ - - user_ = request.user - - if request.POST: - form = ChangepwForm(request.POST, user=user_) - if form.is_valid(): - user_.set_password(form.cleaned_data['password1']) - user_.save() - msg = _("Password changed.") - redirect = "%s?msg=%s" % ( - reverse('user_account_settings'), - urlquote_plus(msg)) - return HttpResponseRedirect(redirect) - else: - form = ChangepwForm(user=user_) - - return render('authopenid/changepw.html', {'form': form }, - context_instance=RequestContext(request)) - -@login_required -def changeemail(request): - """ - changeemail view. It require password or openid to allow change. - - url: /changeemail/ - - template : authopenid/changeemail.html - """ - msg = request.GET.get('msg', '') - extension_args = {} - user_ = request.user - - redirect_to = get_url_host(request) + reverse('user_changeemail') - - if request.POST: - form = ChangeemailForm(request.POST, user=user_) - if form.is_valid(): - if not form.test_openid: - user_.email = form.cleaned_data['email'] - user_.save() - msg = _("Email changed.") - redirect = "%s?msg=%s" % (reverse('user_account_settings'), - urlquote_plus(msg)) - return HttpResponseRedirect(redirect) - else: - request.session['new_email'] = form.cleaned_data['email'] - return ask_openid(request, form.cleaned_data['password'], - redirect_to, on_failure=emailopenid_failure) - elif not request.POST and 'openid.mode' in request.GET: - return complete(request, emailopenid_success, - emailopenid_failure, redirect_to) - else: - form = ChangeemailForm(initial={'email': user_.email}, - user=user_) - - return render('authopenid/changeemail.html', { - 'form': form, - 'msg': msg - }, context_instance=RequestContext(request)) - - -def emailopenid_success(request, identity_url, openid_response): - openid_ = from_openid_response(openid_response) - - user_ = request.user - try: - uassoc = UserAssociation.objects.get( - openid_url__exact=identity_url - ) - except: - return emailopenid_failure(request, - _("No OpenID %s found associated in our database" % identity_url)) - - if uassoc.user.username != request.user.username: - return emailopenid_failure(request, - _("The OpenID %s isn't associated to current user logged in" % - identity_url)) - - new_email = request.session.get('new_email', '') - if new_email: - user_.email = new_email - user_.save() - del request.session['new_email'] - msg = _("Email Changed.") - - redirect = "%s?msg=%s" % (reverse('user_account_settings'), - urlquote_plus(msg)) - return HttpResponseRedirect(redirect) - - -def emailopenid_failure(request, message): - redirect_to = "%s?msg=%s" % ( - reverse('user_changeemail'), urlquote_plus(message)) - return HttpResponseRedirect(redirect_to) - -@login_required -def changeopenid(request): - """ - change openid view. Allow user to change openid - associated to its username. - - url : /changeopenid/ - - template: authopenid/changeopenid.html - """ - - extension_args = {} - openid_url = '' - has_openid = True - msg = request.GET.get('msg', '') - - user_ = request.user - - try: - uopenid = UserAssociation.objects.get(user=user_) - openid_url = uopenid.openid_url - except: - has_openid = False - - redirect_to = get_url_host(request) + reverse('user_changeopenid') - if request.POST and has_openid: - form = ChangeopenidForm(request.POST, user=user_) - if form.is_valid(): - return ask_openid(request, form.cleaned_data['openid_url'], - redirect_to, on_failure=changeopenid_failure) - elif not request.POST and has_openid: - if 'openid.mode' in request.GET: - return complete(request, changeopenid_success, - changeopenid_failure, redirect_to) - - form = ChangeopenidForm(initial={'openid_url': openid_url }, user=user_) - return render('authopenid/changeopenid.html', { - 'form': form, - 'has_openid': has_openid, - 'msg': msg - }, context_instance=RequestContext(request)) - -def changeopenid_success(request, identity_url, openid_response): - openid_ = from_openid_response(openid_response) - is_exist = True - try: - uassoc = UserAssociation.objects.get(openid_url__exact=identity_url) - except: - is_exist = False - - if not is_exist: - try: - uassoc = UserAssociation.objects.get( - user__username__exact=request.user.username - ) - uassoc.openid_url = identity_url - uassoc.save() - except: - uassoc = UserAssociation(user=request.user, - openid_url=identity_url) - uassoc.save() - elif uassoc.user.username != request.user.username: - return changeopenid_failure(request, - _('This OpenID is already associated with another account.')) - - request.session['openids'] = [] - request.session['openids'].append(openid_) - - msg = _("OpenID %s is now associated with your account." % identity_url) - redirect = "%s?msg=%s" % ( - reverse('user_account_settings'), - urlquote_plus(msg)) - return HttpResponseRedirect(redirect) - - -def changeopenid_failure(request, message): - redirect_to = "%s?msg=%s" % ( - reverse('user_changeopenid'), - urlquote_plus(message)) - return HttpResponseRedirect(redirect_to) - -@login_required -def delete(request): - """ - delete view. Allow user to delete its account. Password/openid are required to - confirm it. He should also check the confirm checkbox. - - url : /delete - - template : authopenid/delete.html - """ - - extension_args = {} - - user_ = request.user - - redirect_to = get_url_host(request) + reverse('user_delete') - if request.POST: - form = DeleteForm(request.POST, user=user_) - if form.is_valid(): - if not form.test_openid: - user_.delete() - return signout(request) - else: - return ask_openid(request, form.cleaned_data['password'], - redirect_to, on_failure=deleteopenid_failure) - elif not request.POST and 'openid.mode' in request.GET: - return complete(request, deleteopenid_success, deleteopenid_failure, - redirect_to) - - form = DeleteForm(user=user_) - - msg = request.GET.get('msg','') - return render('authopenid/delete.html', { - 'form': form, - 'msg': msg, - }, context_instance=RequestContext(request)) - -def deleteopenid_success(request, identity_url, openid_response): - openid_ = from_openid_response(openid_response) - - user_ = request.user - try: - uassoc = UserAssociation.objects.get( - openid_url__exact=identity_url - ) - except: - return deleteopenid_failure(request, - _("No OpenID %s found associated in our database" % identity_url)) - - if uassoc.user.username == user_.username: - user_.delete() - return signout(request) - else: - return deleteopenid_failure(request, - _("The OpenID %s isn't associated to current user logged in" % - identity_url)) - - msg = _("Account deleted.") - redirect = "/?msg=%s" % (urlquote_plus(msg)) - return HttpResponseRedirect(redirect) - - -def deleteopenid_failure(request, message): - redirect_to = "%s?msg=%s" % (reverse('user_delete'), urlquote_plus(message)) - return HttpResponseRedirect(redirect_to) - - -def sendpw(request): - """ - send a new password to the user. It return a mail with - a new pasword and a confirm link in. To activate the - new password, the user should click on confirm link. - - url : /sendpw/ - - templates : authopenid/sendpw_email.txt, authopenid/sendpw.html - """ - - msg = request.GET.get('msg','') - if request.POST: - form = EmailPasswordForm(request.POST) - if form.is_valid(): - new_pw = User.objects.make_random_password() - confirm_key = UserPasswordQueue.objects.get_new_confirm_key() - try: - uqueue = UserPasswordQueue.objects.get( - user=form.user_cache - ) - except: - uqueue = UserPasswordQueue( - user=form.user_cache - ) - uqueue.new_password = new_pw - uqueue.confirm_key = confirm_key - uqueue.save() - # send email - current_domain = Site.objects.get_current().domain - subject = _("Request for new password") - message_template = loader.get_template( - 'authopenid/sendpw_email.txt') - message_context = Context({ - 'site_url': 'http://%s' % current_domain, - 'confirm_key': confirm_key, - 'username': form.user_cache.username, - 'password': new_pw, - 'url_confirm': reverse('user_confirmchangepw'), - }) - message = message_template.render(message_context) - send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, - [form.user_cache.email]) - msg = _("A new password has been sent to your email address.") - else: - form = EmailPasswordForm() - - return render('authopenid/sendpw.html', { - 'form': form, - 'msg': msg - }, context_instance=RequestContext(request)) - - -def confirmchangepw(request): - """ - view to set new password when the user click on confirm link - in its mail. Basically it check if the confirm key exist, then - replace old password with new password and remove confirm - ley from the queue. Then it redirect the user to signin - page. - - url : /sendpw/confirm/?key - - """ - confirm_key = request.GET.get('key', '') - if not confirm_key: - return HttpResponseRedirect('/') - - try: - uqueue = UserPasswordQueue.objects.get( - confirm_key__exact=confirm_key - ) - except: - msg = _("Could not change password. Confirmation key '%s'\ - is not registered." % confirm_key) - redirect = "%s?msg=%s" % ( - reverse('user_sendpw'), urlquote_plus(msg)) - return HttpResponseRedirect(redirect) - - try: - user_ = User.objects.get(id=uqueue.user.id) - except: - msg = _("Can not change password. User don't exist anymore \ - in our database.") - redirect = "%s?msg=%s" % (reverse('user_sendpw'), - urlquote_plus(msg)) - return HttpResponseRedirect(redirect) - - user_.set_password(uqueue.new_password) - user_.save() - uqueue.delete() - msg = _("Password changed for %s. You may now sign in." % - user_.username) - redirect = "%s?msg=%s" % (reverse('user_signin'), - urlquote_plus(msg)) - - return HttpResponseRedirect(redirect) diff --git a/forum/__init__.py b/forum/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/forum/admin.py b/forum/admin.py deleted file mode 100644 index 438a99e7..00000000 --- a/forum/admin.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- - -from django.contrib import admin -from models import * - - -class QuestionAdmin(admin.ModelAdmin): - """Question admin class""" - -class TagAdmin(admin.ModelAdmin): - """Tag admin class""" - -class Answerdmin(admin.ModelAdmin): - """Answer admin class""" - -class CommentAdmin(admin.ModelAdmin): - """ admin class""" - -class VoteAdmin(admin.ModelAdmin): - """ admin class""" - -class FlaggedItemAdmin(admin.ModelAdmin): - """ admin class""" - -class FavoriteQuestionAdmin(admin.ModelAdmin): - """ admin class""" - -class QuestionRevisionAdmin(admin.ModelAdmin): - """ admin class""" - -class AnswerRevisionAdmin(admin.ModelAdmin): - """ admin class""" - -class AwardAdmin(admin.ModelAdmin): - """ admin class""" - -class BadgeAdmin(admin.ModelAdmin): - """ admin class""" - -class ReputeAdmin(admin.ModelAdmin): - """ admin class""" - -class ActivityAdmin(admin.ModelAdmin): - """ admin class""" - -class BookAdmin(admin.ModelAdmin): - """ admin class""" - -class BookAuthorInfoAdmin(admin.ModelAdmin): - """ admin class""" - -class BookAuthorRssAdmin(admin.ModelAdmin): - """ admin class""" - - -admin.site.register(Question, QuestionAdmin) -admin.site.register(Tag, TagAdmin) -admin.site.register(Answer, Answerdmin) -admin.site.register(Comment, CommentAdmin) -admin.site.register(Vote, VoteAdmin) -admin.site.register(FlaggedItem, FlaggedItemAdmin) -admin.site.register(FavoriteQuestion, FavoriteQuestionAdmin) -admin.site.register(QuestionRevision, QuestionRevisionAdmin) -admin.site.register(AnswerRevision, AnswerRevisionAdmin) -admin.site.register(Badge, BadgeAdmin) -admin.site.register(Award, AwardAdmin) -admin.site.register(Repute, ReputeAdmin) -admin.site.register(Activity, ActivityAdmin) -admin.site.register(Book, BookAdmin) -admin.site.register(BookAuthorInfo, BookAuthorInfoAdmin) -admin.site.register(BookAuthorRss, BookAuthorRssAdmin) \ No newline at end of file diff --git a/forum/auth.py b/forum/auth.py deleted file mode 100644 index 0608031a..00000000 --- a/forum/auth.py +++ /dev/null @@ -1,443 +0,0 @@ -锘""" -Authorisation related functions. - -The actions a User is authorised to perform are dependent on their reputation -and superuser status. -""" -import datetime -from django.contrib.contenttypes.models import ContentType -from django.db import transaction -from models import Repute -from models import Question -from models import Answer -from const import TYPE_REPUTATION -question_type = ContentType.objects.get_for_model(Question) -answer_type = ContentType.objects.get_for_model(Answer) - -VOTE_UP = 15 -FLAG_OFFENSIVE = 15 -POST_IMAGES = 15 -LEAVE_COMMENTS = 50 -UPLOAD_FILES = 60 -VOTE_DOWN = 100 -CLOSE_OWN_QUESTIONS = 250 -RETAG_OTHER_QUESTIONS = 500 -REOPEN_OWN_QUESTIONS = 500 -EDIT_COMMUNITY_WIKI_POSTS = 750 -EDIT_OTHER_POSTS = 2000 -DELETE_COMMENTS = 2000 -VIEW_OFFENSIVE_FLAGS = 2000 -DISABLE_URL_NOFOLLOW = 2000 -CLOSE_OTHER_QUESTIONS = 3000 -LOCK_POSTS = 4000 - -VOTE_RULES = { - 'scope_votes_per_user_per_day' : 30, # how many votes of one user has everyday - 'scope_flags_per_user_per_day' : 5, # how many times user can flag posts everyday - 'scope_warn_votes_left' : 10, # start when to warn user how many votes left - 'scope_deny_unvote_days' : 1, # if 1 days passed, user can't cancel votes. - 'scope_flags_invisible_main_page' : 3, # post doesn't show on main page if has more than 3 offensive flags - 'scope_flags_delete_post' : 5, # post will be deleted if it has more than 5 offensive flags -} - -REPUTATION_RULES = { - 'initial_score' : 1, - 'scope_per_day_by_upvotes' : 200, - 'gain_by_upvoted' : 10, - 'gain_by_answer_accepted' : 15, - 'gain_by_accepting_answer' : 2, - 'gain_by_downvote_canceled' : 2, - 'gain_by_canceling_downvote' : 1, - 'lose_by_canceling_accepted_answer' : -2, - 'lose_by_accepted_answer_cancled' : -15, - 'lose_by_downvoted' : -2, - 'lose_by_flagged' : -2, - 'lose_by_downvoting' : -1, - 'lose_by_flagged_lastrevision_3_times': -30, - 'lose_by_flagged_lastrevision_5_times': -100, - 'lose_by_upvote_canceled' : -10, -} - -def can_vote_up(user): - """Determines if a User can vote Questions and Answers up.""" - return user.is_authenticated() and ( - user.reputation >= VOTE_UP or - user.is_superuser) - -def can_flag_offensive(user): - """Determines if a User can flag Questions and Answers as offensive.""" - return user.is_authenticated() and ( - user.reputation >= FLAG_OFFENSIVE or - user.is_superuser) - -def can_add_comments(user): - """Determines if a User can add comments to Questions and Answers.""" - return user.is_authenticated() and ( - user.reputation >= LEAVE_COMMENTS or - user.is_superuser) - -def can_vote_down(user): - """Determines if a User can vote Questions and Answers down.""" - return user.is_authenticated() and ( - user.reputation >= VOTE_DOWN or - user.is_superuser) - -def can_retag_questions(user): - """Determines if a User can retag Questions.""" - return user.is_authenticated() and ( - RETAG_OTHER_QUESTIONS <= user.reputation < EDIT_OTHER_POSTS or - user.is_superuser) - -def can_edit_post(user, post): - """Determines if a User can edit the given Question or Answer.""" - return user.is_authenticated() and ( - user.id == post.author_id or - (post.wiki and user.reputation >= EDIT_COMMUNITY_WIKI_POSTS) or - user.reputation >= EDIT_OTHER_POSTS or - user.is_superuser) - -def can_delete_comment(user, comment): - """Determines if a User can delete the given Comment.""" - return user.is_authenticated() and ( - user.id == comment.user_id or - user.reputation >= DELETE_COMMENTS or - user.is_superuser) - -def can_view_offensive_flags(user): - """Determines if a User can view offensive flag counts.""" - return user.is_authenticated() and ( - user.reputation >= VIEW_OFFENSIVE_FLAGS or - user.is_superuser) - -def can_close_question(user, question): - """Determines if a User can close the given Question.""" - return user.is_authenticated() and ( - (user.id == question.author_id and - user.reputation >= CLOSE_OWN_QUESTIONS) or - user.reputation >= CLOSE_OTHER_QUESTIONS or - user.is_superuser) - -def can_lock_posts(user): - """Determines if a User can lock Questions or Answers.""" - return user.is_authenticated() and ( - user.reputation >= LOCK_POSTS or - user.is_superuser) - -def can_follow_url(user): - """Determines if the URL link can be followed by Google search engine.""" - return user.reputation >= DISABLE_URL_NOFOLLOW - -def can_accept_answer(user, question, answer): - return (user.is_authenticated() and - question.author != answer.author and - question.author == user) or user.is_superuser - -# now only support to reopen own question except superuser -def can_reopen_question(user, question): - return (user.is_authenticated() and - user.id == question.author_id and - user.reputation >= REOPEN_OWN_QUESTIONS) or user.is_superuser - -def can_delete_post(user, post): - return (user.is_authenticated() and - user.id == post.author_id) or user.is_superuser - -def can_view_deleted_post(user, post): - return user.is_superuser - -# user preferences view permissions -def is_user_self(request_user, target_user): - return (request_user.is_authenticated() and request_user == target_user) - -def can_view_user_votes(request_user, target_user): - return (request_user.is_authenticated() and request_user == target_user) - -def can_view_user_preferences(request_user, target_user): - return (request_user.is_authenticated() and request_user == target_user) - -def can_view_user_edit(request_user, target_user): - return (request_user.is_authenticated() and request_user == target_user) - -def can_upload_files(request_user): - return (request_user.is_authenticated() and request_user.reputation >= UPLOAD_FILES) or \ - request_user.is_superuser - -########################################### -## actions and reputation changes event -########################################### -def calculate_reputation(origin, offset): - result = int(origin) + int(offset) - return result if result > 0 else 1 - -@transaction.commit_on_success -def onFlaggedItem(item, post, user): - - item.save() - post.offensive_flag_count = post.offensive_flag_count + 1 - post.save() - - post.author.reputation = calculate_reputation(post.author.reputation, - int(REPUTATION_RULES['lose_by_flagged'])) - post.author.save() - - question = post - if ContentType.objects.get_for_model(post) == answer_type: - question = post.question - - reputation = Repute(user=post.author, - negative=int(REPUTATION_RULES['lose_by_flagged']), - question=question, reputed_at=datetime.datetime.now(), - reputation_type=-4, - reputation=post.author.reputation) - reputation.save() - - #todo: These should be updated to work on same revisions. - if post.offensive_flag_count == VOTE_RULES['scope_flags_invisible_main_page'] : - post.author.reputation = calculate_reputation(post.author.reputation, - int(REPUTATION_RULES['lose_by_flagged_lastrevision_3_times'])) - post.author.save() - - reputation = Repute(user=post.author, - negative=int(REPUTATION_RULES['lose_by_flagged_lastrevision_3_times']), - question=question, - reputed_at=datetime.datetime.now(), - reputation_type=-6, - reputation=post.author.reputation) - reputation.save() - - elif post.offensive_flag_count == VOTE_RULES['scope_flags_delete_post']: - post.author.reputation = calculate_reputation(post.author.reputation, - int(REPUTATION_RULES['lose_by_flagged_lastrevision_5_times'])) - post.author.save() - - reputation = Repute(user=post.author, - negative=int(REPUTATION_RULES['lose_by_flagged_lastrevision_5_times']), - question=question, - reputed_at=datetime.datetime.now(), - reputation_type=-7, - reputation=post.author.reputation) - reputation.save() - - post.deleted = True - #post.deleted_at = datetime.datetime.now() - #post.deleted_by = Admin - post.save() - - -@transaction.commit_on_success -def onAnswerAccept(answer, user): - answer.accepted = True - answer.accepted_at = datetime.datetime.now() - answer.question.answer_accepted = True - answer.save() - answer.question.save() - - answer.author.reputation = calculate_reputation(answer.author.reputation, - int(REPUTATION_RULES['gain_by_answer_accepted'])) - answer.author.save() - reputation = Repute(user=answer.author, - positive=int(REPUTATION_RULES['gain_by_answer_accepted']), - question=answer.question, - reputed_at=datetime.datetime.now(), - reputation_type=2, - reputation=answer.author.reputation) - reputation.save() - - user.reputation = calculate_reputation(user.reputation, - int(REPUTATION_RULES['gain_by_accepting_answer'])) - user.save() - reputation = Repute(user=user, - positive=int(REPUTATION_RULES['gain_by_accepting_answer']), - question=answer.question, - reputed_at=datetime.datetime.now(), - reputation_type=3, - reputation=user.reputation) - reputation.save() - -@transaction.commit_on_success -def onAnswerAcceptCanceled(answer, user): - answer.accepted = False - answer.accepted_at = None - answer.question.answer_accepted = False - answer.save() - answer.question.save() - - answer.author.reputation = calculate_reputation(answer.author.reputation, - int(REPUTATION_RULES['lose_by_accepted_answer_cancled'])) - answer.author.save() - reputation = Repute(user=answer.author, - negative=int(REPUTATION_RULES['lose_by_accepted_answer_cancled']), - question=answer.question, - reputed_at=datetime.datetime.now(), - reputation_type=-2, - reputation=answer.author.reputation) - reputation.save() - - user.reputation = calculate_reputation(user.reputation, - int(REPUTATION_RULES['lose_by_canceling_accepted_answer'])) - user.save() - reputation = Repute(user=user, - negative=int(REPUTATION_RULES['lose_by_canceling_accepted_answer']), - question=answer.question, - reputed_at=datetime.datetime.now(), - reputation_type=-1, - reputation=user.reputation) - reputation.save() - -@transaction.commit_on_success -def onUpVoted(vote, post, user): - vote.save() - - post.vote_up_count = int(post.vote_up_count) + 1 - post.score = int(post.score) + 1 - post.save() - - if not post.wiki: - author = post.author - if Repute.objects.get_reputation_by_upvoted_today(author) < int(REPUTATION_RULES['scope_per_day_by_upvotes']): - author.reputation = calculate_reputation(author.reputation, - int(REPUTATION_RULES['gain_by_upvoted'])) - author.save() - - question = post - if ContentType.objects.get_for_model(post) == answer_type: - question = post.question - - reputation = Repute(user=author, - positive=int(REPUTATION_RULES['gain_by_upvoted']), - question=question, - reputed_at=datetime.datetime.now(), - reputation_type=1, - reputation=author.reputation) - reputation.save() - -@transaction.commit_on_success -def onUpVotedCanceled(vote, post, user): - vote.delete() - - post.vote_up_count = int(post.vote_up_count) - 1 - if post.vote_up_count < 0: - post.vote_up_count = 0 - post.score = int(post.score) - 1 - post.save() - - if not post.wiki: - author = post.author - author.reputation = calculate_reputation(author.reputation, - int(REPUTATION_RULES['lose_by_upvote_canceled'])) - author.save() - - question = post - if ContentType.objects.get_for_model(post) == answer_type: - question = post.question - - reputation = Repute(user=author, - negative=int(REPUTATION_RULES['lose_by_upvote_canceled']), - question=question, - reputed_at=datetime.datetime.now(), - reputation_type=-8, - reputation=author.reputation) - reputation.save() - -@transaction.commit_on_success -def onDownVoted(vote, post, user): - vote.save() - - post.vote_down_count = int(post.vote_down_count) + 1 - post.score = int(post.score) - 1 - post.save() - - if not post.wiki: - author = post.author - author.reputation = calculate_reputation(author.reputation, - int(REPUTATION_RULES['lose_by_downvoted'])) - author.save() - - question = post - if ContentType.objects.get_for_model(post) == answer_type: - question = post.question - - reputation = Repute(user=author, - negative=int(REPUTATION_RULES['lose_by_downvoted']), - question=question, - reputed_at=datetime.datetime.now(), - reputation_type=-3, - reputation=author.reputation) - reputation.save() - - user.reputation = calculate_reputation(user.reputation, - int(REPUTATION_RULES['lose_by_downvoting'])) - user.save() - - reputation = Repute(user=user, - negative=int(REPUTATION_RULES['lose_by_downvoting']), - question=question, - reputed_at=datetime.datetime.now(), - reputation_type=-5, - reputation=user.reputation) - reputation.save() - -@transaction.commit_on_success -def onDownVotedCanceled(vote, post, user): - vote.delete() - - post.vote_down_count = int(post.vote_down_count) - 1 - if post.vote_down_count < 0: - post.vote_down_count = 0 - post.score = post.score + 1 - post.save() - - if not post.wiki: - author = post.author - author.reputation = calculate_reputation(author.reputation, - int(REPUTATION_RULES['gain_by_downvote_canceled'])) - author.save() - - question = post - if ContentType.objects.get_for_model(post) == answer_type: - question = post.question - - reputation = Repute(user=author, - positive=int(REPUTATION_RULES['gain_by_downvote_canceled']), - question=question, - reputed_at=datetime.datetime.now(), - reputation_type=4, - reputation=author.reputation) - reputation.save() - - user.reputation = calculate_reputation(user.reputation, - int(REPUTATION_RULES['gain_by_canceling_downvote'])) - user.save() - - reputation = Repute(user=user, - positive=int(REPUTATION_RULES['gain_by_canceling_downvote']), - question=question, - reputed_at=datetime.datetime.now(), - reputation_type=5, - reputation=user.reputation) - reputation.save() - -def onDeleteCanceled(post, user): - post.deleted = False - post.deleted_by = None - post.deleted_at = None - post.save() - for tag in list(post.tags.all()): - if tag.used_count == 1 and tag.deleted: - tag.deleted = False - tag.deleted_by = None - tag.deleted_at = None - tag.save() - -def onDeleted(post, user): - post.deleted = True - post.deleted_by = user - post.deleted_at = datetime.datetime.now() - post.save() - - for tag in list(post.tags.all()): - if tag.used_count == 1: - tag.deleted = True - tag.deleted_by = user - tag.deleted_at = datetime.datetime.now() - tag.save() diff --git a/forum/const.py b/forum/const.py deleted file mode 100644 index f6649cc4..00000000 --- a/forum/const.py +++ /dev/null @@ -1,87 +0,0 @@ -# encoding:utf-8 -from django.utils.translation import ugettext as _ -""" -All constants could be used in other modules -For reasons that models, views can't have unicode text in this project, all unicode text go here. -""" -CLOSE_REASONS = ( - (1, _('duplicate question')), - (2, _('question if off-topic or not relevant')), - (3, _('too subjective and argumentative')), - (4, _('is not an answer to the question')), - (5, _('the question is answered, right answer was accepted')), - (6, _('problem is not reproducible or outdated')), - #(7, u'澶眬閮ㄣ佹湰鍦板寲鐨勯棶棰',) - (7, _('question contains offensive inappropriate, or malicious remarks')), - (8, _('spam or advertising')), -) - -TYPE_REPUTATION = ( - (1, 'gain_by_upvoted'), - (2, 'gain_by_answer_accepted'), - (3, 'gain_by_accepting_answer'), - (4, 'gain_by_downvote_canceled'), - (5, 'gain_by_canceling_downvote'), - (-1, 'lose_by_canceling_accepted_answer'), - (-2, 'lose_by_accepted_answer_cancled'), - (-3, 'lose_by_downvoted'), - (-4, 'lose_by_flagged'), - (-5, 'lose_by_downvoting'), - (-6, 'lose_by_flagged_lastrevision_3_times'), - (-7, 'lose_by_flagged_lastrevision_5_times'), - (-8, 'lose_by_upvote_canceled'), -) - -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 -#TYPE_ACTIVITY_EDIT_QUESTION=17 -#TYPE_ACTIVITY_EDIT_ANSWER=18 - -TYPE_ACTIVITY = ( - (TYPE_ACTIVITY_ASK_QUESTION, _('question')), - (TYPE_ACTIVITY_ANSWER, _('answer')), - (TYPE_ACTIVITY_COMMENT_QUESTION, _('commented question')), - (TYPE_ACTIVITY_COMMENT_ANSWER, _('commented answer')), - (TYPE_ACTIVITY_UPDATE_QUESTION, _('edited question')), - (TYPE_ACTIVITY_UPDATE_ANSWER, _('edited answer')), - (TYPE_ACTIVITY_PRIZE, _('received award')), - (TYPE_ACTIVITY_MARK_ANSWER, _('marked best answer')), - (TYPE_ACTIVITY_VOTE_UP, _('upvoted')), - (TYPE_ACTIVITY_VOTE_DOWN, _('downvoted')), - (TYPE_ACTIVITY_CANCEL_VOTE, _('canceled vote')), - (TYPE_ACTIVITY_DELETE_QUESTION, _('deleted question')), - (TYPE_ACTIVITY_DELETE_ANSWER, _('deleted answer')), - (TYPE_ACTIVITY_MARK_OFFENSIVE, _('marked offensive')), - (TYPE_ACTIVITY_UPDATE_TAGS, _('updated tags')), - (TYPE_ACTIVITY_FAVORITE, _('selected favorite')), - (TYPE_ACTIVITY_USER_FULL_UPDATED, _('completed user profile')), -) - -TYPE_RESPONSE = { - 'QUESTION_ANSWERED' : 'question_answered', - 'QUESTION_COMMENTED': 'question_commented', - 'ANSWER_COMMENTED' : 'answer_commented', - 'ANSWER_ACCEPTED' : 'answer_accepted', -} - -CONST = { - 'closed' : _('[closed]'), - 'deleted' : _('[deleted]'), - 'default_version' : _('initial version'), - 'retagged' : _('retagged'), -} diff --git a/forum/diff.py b/forum/diff.py deleted file mode 100644 index d741d788..00000000 --- a/forum/diff.py +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/python2.2 -"""HTML Diff: http://www.aaronsw.com/2002/diff -Rough code, badly documented. Send me comments and patches.""" - -__author__ = 'Aaron Swartz ' -__copyright__ = '(C) 2003 Aaron Swartz. GNU GPL 2.' -__version__ = '0.22' - -import difflib, string - -def isTag(x): return x[0] == "<" and x[-1] == ">" - -def textDiff(a, b): - """Takes in strings a and b and returns a human-readable HTML diff.""" - - out = [] - a, b = html2list(a), html2list(b) - s = difflib.SequenceMatcher(None, a, b) - for e in s.get_opcodes(): - if e[0] == "replace": - # @@ need to do something more complicated here - # call textDiff but not for html, but for some html... ugh - # gonna cop-out for now - out.append(''+''.join(a[e[1]:e[2]]) + ''+''.join(b[e[3]:e[4]])+"") - elif e[0] == "delete": - out.append(''+ ''.join(a[e[1]:e[2]]) + "") - elif e[0] == "insert": - out.append(''+''.join(b[e[3]:e[4]]) + "") - elif e[0] == "equal": - out.append(''.join(b[e[3]:e[4]])) - else: - raise "Um, something's broken. I didn't expect a '" + `e[0]` + "'." - return ''.join(out) - -def html2list(x, b=0): - mode = 'char' - cur = '' - out = [] - for c in x: - if mode == 'tag': - if c == '>': - if b: cur += ']' - else: cur += c - out.append(cur); cur = ''; mode = 'char' - else: cur += c - elif mode == 'char': - if c == '<': - out.append(cur) - if b: cur = '[' - else: cur = c - mode = 'tag' - elif c in string.whitespace: out.append(cur+c); cur = '' - else: cur += c - out.append(cur) - return filter(lambda x: x is not '', out) - -if __name__ == '__main__': - import sys - try: - a, b = sys.argv[1:3] - except ValueError: - print "htmldiff: highlight the differences between two html files" - print "usage: " + sys.argv[0] + " a b" - sys.exit(1) - print textDiff(open(a).read(), open(b).read()) - diff --git a/forum/feed.py b/forum/feed.py deleted file mode 100644 index a4218630..00000000 --- a/forum/feed.py +++ /dev/null @@ -1,43 +0,0 @@ -锘#!/usr/bin/env python -#encoding:utf-8 -#------------------------------------------------------------------------------- -# Name: Syndication feed class for subsribtion -# Purpose: -# -# Author: Mike -# -# Created: 29/01/2009 -# Copyright: (c) CNPROG.COM 2009 -# Licence: GPL V2 -#------------------------------------------------------------------------------- -from django.contrib.syndication.feeds import Feed, FeedDoesNotExist -from django.utils.translation import ugettext as _ -from models import Question -class RssLastestQuestionsFeed(Feed): - title = _('site title') + _(' - ') + _('site slogan') + _(' - ')+ _('latest questions') - #EDIT!!! - link = 'http://where.com/questions/' - description = _('meta site content') - #ttl = 10 - copyright = _('copyright message') - - def item_link(self, item): - return '/questions/%s/' % item.id - - def item_author_name(self, item): - return item.author.username - - def item_author_link(self, item): - return item.author.get_profile_url() - - def item_pubdate(self, item): - return item.added_at - - def items(self, item): - return Question.objects.filter(deleted=False).order_by('-added_at')[:30] - -def main(): - pass - -if __name__ == '__main__': - main() diff --git a/forum/forms.py b/forum/forms.py deleted file mode 100644 index 1b811ad9..00000000 --- a/forum/forms.py +++ /dev/null @@ -1,193 +0,0 @@ -import re -from datetime import date -from django import forms -from models import * -from const import * -from django.utils.translation import ugettext as _ - -class TitleField(forms.CharField): - def __init__(self, *args, **kwargs): - super(TitleField, self).__init__(*args, **kwargs) - self.required = True - self.widget = forms.TextInput(attrs={'size' : 70, 'autocomplete' : 'off'}) - self.max_length = 255 - self.label = _('title') - self.help_text = _('please enter a descriptive title for your question') - self.initial = '' - - def clean(self, value): - if len(value) < 10: - raise forms.ValidationError(_('title must be > 10 characters')) - - return value - -class EditorField(forms.CharField): - def __init__(self, *args, **kwargs): - super(EditorField, self).__init__(*args, **kwargs) - self.required = True - self.widget = forms.Textarea(attrs={'id':'editor'}) - self.label = _('content') - self.help_text = u'' - self.initial = '' - - def clean(self, value): - if len(value) < 10: - raise forms.ValidationError(_('question content must be > 10 characters')) - - return value - -class TagNamesField(forms.CharField): - def __init__(self, *args, **kwargs): - super(TagNamesField, self).__init__(*args, **kwargs) - self.required = True - self.widget = forms.TextInput(attrs={'size' : 50, 'autocomplete' : 'off'}) - self.max_length = 255 - self.label = _('tags') - self.help_text = _('please use space to separate tags (this enables autocomplete feature)') - self.initial = '' - - def clean(self, value): - value = super(TagNamesField, self).clean(value) - data = value.strip() - if len(data) < 1: - raise forms.ValidationError(_('tags are required')) - list = data.split(' ') - list_temp = [] - if len(list) > 5: - raise forms.ValidationError(_('please use 5 tags or less')) - for tag in list: - if len(tag) > 20: - raise forms.ValidationError(_('tags must be shorter than 20 characters')) - #take tag regex from settings - tagname_re = re.compile(r'[a-z0-9]+') - if not tagname_re.match(tag): - raise forms.ValidationError(_('please use following characters in tags: letters \'a-z\', numbers, and characters \'.-_#\'')) - # only keep one same tag - if tag not in list_temp and len(tag.strip()) > 0: - list_temp.append(tag) - return u' '.join(list_temp) - -class WikiField(forms.BooleanField): - def __init__(self, *args, **kwargs): - super(WikiField, self).__init__(*args, **kwargs) - self.required = False - self.label = _('community wiki') - self.help_text = _('if you choose community wiki option, the question and answer do not generate points and name of author will not be shown') - - -class SummaryField(forms.CharField): - def __init__(self, *args, **kwargs): - super(SummaryField, self).__init__(*args, **kwargs) - self.required = False - self.widget = forms.TextInput(attrs={'size' : 50, 'autocomplete' : 'off'}) - self.max_length = 300 - self.label = _('update summary:') - self.help_text = _('enter a brief summary of your revision (e.g. fixed spelling, grammar, improved style, this field is optional)') - -class AskForm(forms.Form): - title = TitleField() - text = EditorField() - tags = TagNamesField() - wiki = WikiField() - - openid = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 40, 'class':'openid-input'})) - user = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) - email = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) - - - -class AnswerForm(forms.Form): - text = EditorField() - wiki = WikiField() - openid = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 40, 'class':'openid-input'})) - user = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) - email = forms.CharField(required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) - def __init__(self, question, *args, **kwargs): - super(AnswerForm, self).__init__(*args, **kwargs) - if question.wiki: - self.fields['wiki'].initial = True - -class CloseForm(forms.Form): - reason = forms.ChoiceField(choices=CLOSE_REASONS) - -class RetagQuestionForm(forms.Form): - tags = TagNamesField() - # initialize the default values - def __init__(self, question, *args, **kwargs): - super(RetagQuestionForm, self).__init__(*args, **kwargs) - self.fields['tags'].initial = question.tagnames - -class RevisionForm(forms.Form): - """ - Lists revisions of a Question or Answer - """ - revision = forms.ChoiceField(widget=forms.Select(attrs={'style' : 'width:520px'})) - - def __init__(self, post, latest_revision, *args, **kwargs): - super(RevisionForm, self).__init__(*args, **kwargs) - revisions = post.revisions.all().values_list( - 'revision', 'author__username', 'revised_at', 'summary') - date_format = '%c' - self.fields['revision'].choices = [ - (r[0], u'%s - %s (%s) %s' % (r[0], r[1], r[2].strftime(date_format), r[3])) - for r in revisions] - self.fields['revision'].initial = latest_revision.revision - -class EditQuestionForm(forms.Form): - title = TitleField() - text = EditorField() - tags = TagNamesField() - summary = SummaryField() - - def __init__(self, question, revision, *args, **kwargs): - super(EditQuestionForm, self).__init__(*args, **kwargs) - self.fields['title'].initial = revision.title - self.fields['text'].initial = revision.text - self.fields['tags'].initial = revision.tagnames - # Once wiki mode is enabled, it can't be disabled - if not question.wiki: - self.fields['wiki'] = WikiField() - -class EditAnswerForm(forms.Form): - text = EditorField() - summary = SummaryField() - - def __init__(self, answer, revision, *args, **kwargs): - super(EditAnswerForm, self).__init__(*args, **kwargs) - self.fields['text'].initial = revision.text - -class EditUserForm(forms.Form): - email = forms.EmailField(label=u'Email', help_text=_('this email does not have to be linked to gravatar'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) - realname = forms.CharField(label=_('Real name'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) - website = forms.URLField(label=_('Website'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) - city = forms.CharField(label=_('Location'), required=False, max_length=255, widget=forms.TextInput(attrs={'size' : 35})) - birthday = forms.DateField(label=_('Date of birth'), help_text=_('will not be shown, used to calculate age, format: YYYY-MM-DD'), required=False, widget=forms.TextInput(attrs={'size' : 35})) - about = forms.CharField(label=_('Profile'), required=False, widget=forms.Textarea(attrs={'cols' : 60})) - - def __init__(self, user, *args, **kwargs): - super(EditUserForm, self).__init__(*args, **kwargs) - self.fields['email'].initial = user.email - self.fields['realname'].initial = user.real_name - self.fields['website'].initial = user.website - self.fields['city'].initial = user.location - - if user.date_of_birth is not None: - self.fields['birthday'].initial = user.date_of_birth - else: - self.fields['birthday'].initial = '1990-01-01' - self.fields['about'].initial = user.about - self.user = user - - def clean_email(self): - """For security reason one unique email in database""" - if self.user.email != self.cleaned_data['email']: - if 'email' in self.cleaned_data: - try: - user = User.objects.get(email = self.cleaned_data['email']) - except User.DoesNotExist: - return self.cleaned_data['email'] - except User.MultipleObjectsReturned: - raise forms.ValidationError(_('this email has already been registered, please use another one')) - raise forms.ValidationError(_('this email has already been registered, please use another one')) - else: - return self.cleaned_data['email'] diff --git a/forum/management/__init__.py b/forum/management/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/forum/management/commands/__init__.py b/forum/management/commands/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/forum/management/commands/base_command.py b/forum/management/commands/base_command.py deleted file mode 100644 index c073bf7a..00000000 --- a/forum/management/commands/base_command.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/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 = 1 WHERE id in (%s)"\ - % ','.join('%s' % item for item in activity_ids) - cursor.execute(query) - - - - - diff --git a/forum/management/commands/clean_award_badges.py b/forum/management/commands/clean_award_badges.py deleted file mode 100644 index df3d2917..00000000 --- a/forum/management/commands/clean_award_badges.py +++ /dev/null @@ -1,58 +0,0 @@ -#------------------------------------------------------------------------------- -# 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: - 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 = 0" - 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/multi_award_badges.py b/forum/management/commands/multi_award_badges.py deleted file mode 100644 index 723a8cec..00000000 --- a/forum/management/commands/multi_award_badges.py +++ /dev/null @@ -1,347 +0,0 @@ -#!/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 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: - 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 \ - act.is_auditted = 0" % (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 \ - act.is_auditted = 0" % (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 \ - act.is_auditted = 0" % (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 \ - act.is_auditted = 0" % (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\ - act.is_auditted = 0" % (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\ - act.is_auditted = 0" % (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 = 1 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\ - DATEDIFF(a.added_at, q.added_at) >= 60 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=objet_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() \ No newline at end of file diff --git a/forum/management/commands/once_award_badges.py b/forum/management/commands/once_award_badges.py deleted file mode 100644 index 011c28fd..00000000 --- a/forum/management/commands/once_award_badges.py +++ /dev/null @@ -1,327 +0,0 @@ -锘#!/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 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: - 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 is_auditted = 0 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(*) 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 vote_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(*) 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 vote_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(*) 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 vote_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/management/commands/sample_command.py b/forum/management/commands/sample_command.py deleted file mode 100644 index 55e67235..00000000 --- a/forum/management/commands/sample_command.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.core.management.base import NoArgsCommand -from forum.models import Comment - -class Command(NoArgsCommand): - def handle_noargs(self, **options): - objs = Comment.objects.all() - print objs \ No newline at end of file diff --git a/forum/managers.py b/forum/managers.py deleted file mode 100644 index 94f58ea7..00000000 --- a/forum/managers.py +++ /dev/null @@ -1,208 +0,0 @@ -锘縤mport datetime -import logging -from django.contrib.auth.models import User, UserManager -from django.db import connection, models, transaction -from django.db.models import Q -from forum.models import * - -class QuestionManager(models.Manager): - def update_tags(self, question, tagnames, user): - """ - Updates Tag associations for a question to match the given - tagname string. - - Returns ``True`` if tag usage counts were updated as a result, - ``False`` otherwise. - """ - from forum.models import Tag - current_tags = list(question.tags.all()) - current_tagnames = set(t.name for t in current_tags) - updated_tagnames = set(t for t in tagnames.split(' ') if t) - modified_tags = [] - - removed_tags = [t for t in current_tags - if t.name not in updated_tagnames] - if removed_tags: - modified_tags.extend(removed_tags) - question.tags.remove(*removed_tags) - - added_tagnames = updated_tagnames - current_tagnames - if added_tagnames: - added_tags = Tag.objects.get_or_create_multiple(added_tagnames, - user) - modified_tags.extend(added_tags) - question.tags.add(*added_tags) - - if modified_tags: - Tag.objects.update_use_counts(modified_tags) - return True - - return False - - def update_answer_count(self, question): - """ - Executes an UPDATE query to update denormalised data with the - number of answers the given question has. - """ - - # for some reasons, this Answer class failed to be imported, - # although we have imported all classes from models on top. - from forum.models import Answer - self.filter(id=question.id).update( - answer_count=Answer.objects.get_answers_from_question(question).count()) - - def update_view_count(self, question): - """ - update counter+1 when user browse question page - """ - self.filter(id=question.id).update(view_count = question.view_count + 1) - - def update_favorite_count(self, question): - """ - update favourite_count for given question - """ - from forum.models import FavoriteQuestion - self.filter(id=question.id).update(favourite_count = FavoriteQuestion.objects.filter(question=question).count()) - - def get_similar_questions(self, question): - """ - Get 10 similar questions for given one. - This will search the same tag list for give question(by exactly same string) first. - Questions with the individual tags will be added to list if above questions are not full. - """ - #print datetime.datetime.now() - from forum.models import Question - questions = list(Question.objects.filter(tagnames = question.tagnames).all()) - - tags_list = question.tags.all() - for tag in tags_list: - extend_questions = Question.objects.filter(tags__id = tag.id)[:50] - for item in extend_questions: - if item not in questions and len(questions) < 10: - questions.append(item) - - #print datetime.datetime.now() - return questions - -class TagManager(models.Manager): - UPDATE_USED_COUNTS_QUERY = ( - 'UPDATE tag ' - 'SET used_count = (' - 'SELECT COUNT(*) FROM question_tags ' - 'WHERE tag_id = tag.id' - ') ' - 'WHERE id IN (%s)') - - def get_or_create_multiple(self, names, user): - """ - Fetches a list of Tags with the given names, creating any Tags - which don't exist when necesssary. - """ - tags = list(self.filter(name__in=names)) - #Set all these tag visible - for tag in tags: - if tag.deleted: - tag.deleted = False - tag.deleted_by = None - tag.deleted_at = None - tag.save() - - if len(tags) < len(names): - existing_names = set(tag.name for tag in tags) - new_names = [name for name in names if name not in existing_names] - tags.extend([self.create(name=name, created_by=user) - for name in new_names if self.filter(name=name).count() == 0 and len(name.strip()) > 0]) - - return tags - - def update_use_counts(self, tags): - """Updates the given Tags with their current use counts.""" - if not tags: - return - cursor = connection.cursor() - query = self.UPDATE_USED_COUNTS_QUERY % ','.join(['%s'] * len(tags)) - cursor.execute(query, [tag.id for tag in tags]) - transaction.commit_unless_managed() - -class AnswerManager(models.Manager): - GET_ANSWERS_FROM_USER_QUESTIONS = u'SELECT answer.* FROM answer INNER JOIN question ON answer.question_id = question.id WHERE question.author_id =%s AND answer.author_id <> %s' - def get_answers_from_question(self, question, user=None): - """ - Retrieves visibile answers for the given question. Delete answers - are only visibile to the person who deleted them. - """ - - if user is None or not user.is_authenticated(): - return self.filter(question=question, deleted=False) - else: - return self.filter(Q(question=question), - Q(deleted=False) | Q(deleted_by=user)) - - def get_answers_from_questions(self, user_id): - """ - Retrieves visibile answers for the given question. Which are not included own answers - """ - cursor = connection.cursor() - cursor.execute(self.GET_ANSWERS_FROM_USER_QUESTIONS, [user_id, user_id]) - return cursor.fetchall() - -class VoteManager(models.Manager): - COUNT_UP_VOTE_BY_USER = "SELECT count(*) FROM vote WHERE user_id = %s AND vote = 1" - COUNT_DOWN_VOTE_BY_USER = "SELECT count(*) FROM vote WHERE user_id = %s AND vote = -1" - COUNT_VOTES_PER_DAY_BY_USER = "SELECT COUNT(*) FROM vote WHERE user_id = %s AND DATE(voted_at) = DATE(NOW())" - def get_up_vote_count_from_user(self, user): - if user is not None: - cursor = connection.cursor() - cursor.execute(self.COUNT_UP_VOTE_BY_USER, [user.id]) - row = cursor.fetchone() - return row[0] - else: - return 0 - - def get_down_vote_count_from_user(self, user): - if user is not None: - cursor = connection.cursor() - cursor.execute(self.COUNT_DOWN_VOTE_BY_USER, [user.id]) - row = cursor.fetchone() - return row[0] - else: - return 0 - - def get_votes_count_today_from_user(self, user): - if user is not None: - cursor = connection.cursor() - cursor.execute(self.COUNT_VOTES_PER_DAY_BY_USER, [user.id]) - row = cursor.fetchone() - return row[0] - - else: - return 0 - -class FlaggedItemManager(models.Manager): - COUNT_FLAGS_PER_DAY_BY_USER = "SELECT COUNT(*) FROM flagged_item WHERE user_id = %s AND DATE(flagged_at) = DATE(NOW())" - def get_flagged_items_count_today(self, user): - if user is not None: - cursor = connection.cursor() - cursor.execute(self.COUNT_FLAGS_PER_DAY_BY_USER, [user.id]) - row = cursor.fetchone() - return row[0] - - else: - return 0 - -class ReputeManager(models.Manager): - COUNT_REPUTATION_PER_DAY_BY_USER = "SELECT SUM(positive)+SUM(negative) FROM repute WHERE user_id = %s AND (reputation_type=1 OR reputation_type=-8) AND DATE(reputed_at) = DATE(NOW())" - def get_reputation_by_upvoted_today(self, user): - """ - For one user in one day, he can only earn rep till certain score (ep. +200) - by upvoted(also substracted from upvoted canceled). This is because we need - to prohibit gaming system by upvoting/cancel again and again. - """ - if user is not None: - cursor = connection.cursor() - cursor.execute(self.COUNT_REPUTATION_PER_DAY_BY_USER, [user.id]) - row = cursor.fetchone() - return row[0] - - else: - return 0 \ No newline at end of file diff --git a/forum/models.py b/forum/models.py deleted file mode 100644 index aba2bf0b..00000000 --- a/forum/models.py +++ /dev/null @@ -1,653 +0,0 @@ -锘# encoding:utf-8 -import datetime -import hashlib -from urllib import quote_plus, urlencode -from django.db import models -from django.utils.html import strip_tags -from django.core.urlresolvers import reverse -from django.contrib.auth.models import User -from django.contrib.contenttypes import generic -from django.contrib.contenttypes.models import ContentType -from django.template.defaultfilters import slugify -from django.db.models.signals import post_delete, post_save, pre_save -from django.utils.translation import ugettext as _ -import django.dispatch - -from forum.managers import * -from const import * - -class Tag(models.Model): - name = models.CharField(max_length=255, unique=True) - created_by = models.ForeignKey(User, related_name='created_tags') - deleted = models.BooleanField(default=False) - deleted_at = models.DateTimeField(null=True, blank=True) - deleted_by = models.ForeignKey(User, null=True, blank=True, related_name='deleted_tags') - # Denormalised data - used_count = models.PositiveIntegerField(default=0) - - objects = TagManager() - - class Meta: - db_table = u'tag' - ordering = ('-used_count', 'name') - - def __unicode__(self): - return self.name - -class Comment(models.Model): - content_type = models.ForeignKey(ContentType) - object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') - user = models.ForeignKey(User, related_name='comments') - comment = models.CharField(max_length=300) - added_at = models.DateTimeField(default=datetime.datetime.now) - - class Meta: - ordering = ('-added_at',) - db_table = u'comment' - def __unicode__(self): - return self.comment - -class Vote(models.Model): - VOTE_UP = +1 - VOTE_DOWN = -1 - VOTE_CHOICES = ( - (VOTE_UP, u'Up'), - (VOTE_DOWN, u'Down'), - ) - - content_type = models.ForeignKey(ContentType) - object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') - user = models.ForeignKey(User, related_name='votes') - vote = models.SmallIntegerField(choices=VOTE_CHOICES) - voted_at = models.DateTimeField(default=datetime.datetime.now) - - objects = VoteManager() - - class Meta: - unique_together = ('content_type', 'object_id', 'user') - db_table = u'vote' - def __unicode__(self): - return '[%s] voted at %s: %s' %(self.user, self.voted_at, self.vote) - - def is_upvote(self): - return self.vote == self.VOTE_UP - - def is_downvote(self): - return self.vote == self.VOTE_DOWN - -class FlaggedItem(models.Model): - """A flag on a Question or Answer indicating offensive content.""" - content_type = models.ForeignKey(ContentType) - object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') - user = models.ForeignKey(User, related_name='flagged_items') - flagged_at = models.DateTimeField(default=datetime.datetime.now) - - objects = FlaggedItemManager() - - class Meta: - unique_together = ('content_type', 'object_id', 'user') - db_table = u'flagged_item' - def __unicode__(self): - return '[%s] flagged at %s' %(self.user, self.flagged_at) - -class Question(models.Model): - title = models.CharField(max_length=300) - author = models.ForeignKey(User, related_name='questions') - added_at = models.DateTimeField(default=datetime.datetime.now) - tags = models.ManyToManyField(Tag, related_name='questions') - # Status - wiki = models.BooleanField(default=False) - wikified_at = models.DateTimeField(null=True, blank=True) - answer_accepted = models.BooleanField(default=False) - closed = models.BooleanField(default=False) - closed_by = models.ForeignKey(User, null=True, blank=True, related_name='closed_questions') - closed_at = models.DateTimeField(null=True, blank=True) - close_reason = models.SmallIntegerField(choices=CLOSE_REASONS, null=True, blank=True) - deleted = models.BooleanField(default=False) - deleted_at = models.DateTimeField(null=True, blank=True) - deleted_by = models.ForeignKey(User, null=True, blank=True, related_name='deleted_questions') - locked = models.BooleanField(default=False) - locked_by = models.ForeignKey(User, null=True, blank=True, related_name='locked_questions') - locked_at = models.DateTimeField(null=True, blank=True) - # Denormalised data - score = models.IntegerField(default=0) - vote_up_count = models.IntegerField(default=0) - vote_down_count = models.IntegerField(default=0) - answer_count = models.PositiveIntegerField(default=0) - comment_count = models.PositiveIntegerField(default=0) - view_count = models.PositiveIntegerField(default=0) - offensive_flag_count = models.SmallIntegerField(default=0) - favourite_count = models.PositiveIntegerField(default=0) - last_edited_at = models.DateTimeField(null=True, blank=True) - last_edited_by = models.ForeignKey(User, null=True, blank=True, related_name='last_edited_questions') - last_activity_at = models.DateTimeField(default=datetime.datetime.now) - last_activity_by = models.ForeignKey(User, related_name='last_active_in_questions') - tagnames = models.CharField(max_length=125) - summary = models.CharField(max_length=180) - html = models.TextField() - comments = generic.GenericRelation(Comment) - votes = generic.GenericRelation(Vote) - flagged_items = generic.GenericRelation(FlaggedItem) - - objects = QuestionManager() - - def save(self, **kwargs): - """ - Overridden to manually manage addition of tags when the object - is first saved. - - This is required as we're using ``tagnames`` as the sole means of - adding and editing tags. - """ - initial_addition = (self.id is None) - super(Question, self).save(**kwargs) - if initial_addition: - tags = Tag.objects.get_or_create_multiple(self.tagname_list(), - self.author) - self.tags.add(*tags) - Tag.objects.update_use_counts(tags) - - def tagname_list(self): - """Creates a list of Tag names from the ``tagnames`` attribute.""" - return [name for name in self.tagnames.split(u' ')] - - def get_absolute_url(self): - return '%s%s' % (reverse('question', args=[self.id]), self.title) - - def has_favorite_by_user(self, user): - if not user.is_authenticated(): - return False - return FavoriteQuestion.objects.filter(question=self, user=user).count() > 0 - - def get_answer_count_by_user(self, user_id): - query_set = Answer.objects.filter(author__id=user_id) - return query_set.filter(question=self).count() - - def get_question_title(self): - if self.closed: - attr = CONST['closed'] - elif self.deleted: - attr = CONST['deleted'] - else: - attr = None - return u'%s %s' % (self.title, attr) if attr is not None else self.title - - def get_revision_url(self): - return reverse('question_revisions', args=[self.id]) - - def get_latest_revision(self): - return self.revisions.all()[0] - - def __unicode__(self): - return self.title - - class Meta: - db_table = u'question' - -class QuestionRevision(models.Model): - """A revision of a Question.""" - question = models.ForeignKey(Question, related_name='revisions') - revision = models.PositiveIntegerField(blank=True) - title = models.CharField(max_length=300) - author = models.ForeignKey(User, related_name='question_revisions') - revised_at = models.DateTimeField() - tagnames = models.CharField(max_length=125) - summary = models.CharField(max_length=300, blank=True) - text = models.TextField() - - class Meta: - db_table = u'question_revision' - ordering = ('-revision',) - - def get_question_title(self): - return self.question.title - - def get_absolute_url(self): - return '/questions/%s/revisions' % (self.question.id) - - def save(self, **kwargs): - """Looks up the next available revision number.""" - if not self.revision: - self.revision = QuestionRevision.objects.filter( - question=self.question).values_list('revision', - flat=True)[0] + 1 - super(QuestionRevision, self).save(**kwargs) - - def __unicode__(self): - return u'revision %s of %s' % (self.revision, self.title) - -class Answer(models.Model): - question = models.ForeignKey(Question, related_name='answers') - author = models.ForeignKey(User, related_name='answers') - added_at = models.DateTimeField(default=datetime.datetime.now) - # Status - wiki = models.BooleanField(default=False) - wikified_at = models.DateTimeField(null=True, blank=True) - accepted = models.BooleanField(default=False) - accepted_at = models.DateTimeField(null=True, blank=True) - deleted = models.BooleanField(default=False) - deleted_by = models.ForeignKey(User, null=True, blank=True, related_name='deleted_answers') - locked = models.BooleanField(default=False) - locked_by = models.ForeignKey(User, null=True, blank=True, related_name='locked_answers') - locked_at = models.DateTimeField(null=True, blank=True) - # Denormalised data - score = models.IntegerField(default=0) - vote_up_count = models.IntegerField(default=0) - vote_down_count = models.IntegerField(default=0) - comment_count = models.PositiveIntegerField(default=0) - offensive_flag_count = models.SmallIntegerField(default=0) - last_edited_at = models.DateTimeField(null=True, blank=True) - last_edited_by = models.ForeignKey(User, null=True, blank=True, related_name='last_edited_answers') - html = models.TextField() - comments = generic.GenericRelation(Comment) - votes = generic.GenericRelation(Vote) - flagged_items = generic.GenericRelation(FlaggedItem) - - objects = AnswerManager() - - def get_user_vote(self, user): - votes = self.votes.filter(user=user) - if votes.count() > 0: - return votes[0] - else: - return None - - def get_latest_revision(self): - return self.revisions.all()[0] - - def get_question_title(self): - return self.question.title - - def get_absolute_url(self): - return '%s%s#%s' % (reverse('question', args=[self.question.id]), self.question.title, self.id) - - class Meta: - db_table = u'answer' - - def __unicode__(self): - return self.html - -class AnswerRevision(models.Model): - """A revision of an Answer.""" - answer = models.ForeignKey(Answer, related_name='revisions') - revision = models.PositiveIntegerField() - author = models.ForeignKey(User, related_name='answer_revisions') - revised_at = models.DateTimeField() - summary = models.CharField(max_length=300, blank=True) - text = models.TextField() - - def get_absolute_url(self): - return '/answers/%s/revisions' % (self.answer.id) - - def get_question_title(self): - return self.answer.question.title - - class Meta: - db_table = u'answer_revision' - ordering = ('-revision',) - - def save(self, **kwargs): - """Looks up the next available revision number if not set.""" - if not self.revision: - self.revision = AnswerRevision.objects.filter( - answer=self.answer).values_list('revision', - flat=True)[0] + 1 - super(AnswerRevision, self).save(**kwargs) - -class FavoriteQuestion(models.Model): - """A favorite Question of a User.""" - question = models.ForeignKey(Question) - user = models.ForeignKey(User, related_name='user_favorite_questions') - added_at = models.DateTimeField(default=datetime.datetime.now) - class Meta: - db_table = u'favorite_question' - def __unicode__(self): - return '[%s] favorited at %s' %(self.user, self.added_at) - -class Badge(models.Model): - """Awarded for notable actions performed on the site by Users.""" - GOLD = 1 - SILVER = 2 - BRONZE = 3 - TYPE_CHOICES = ( - (GOLD, _('gold')), - (SILVER, _('silver')), - (BRONZE, _('bronze')), - ) - - name = models.CharField(max_length=50) - type = models.SmallIntegerField(choices=TYPE_CHOICES) - slug = models.SlugField(max_length=50, blank=True) - description = models.CharField(max_length=300) - multiple = models.BooleanField(default=False) - # Denormalised data - awarded_count = models.PositiveIntegerField(default=0) - - class Meta: - db_table = u'badge' - ordering = ('name',) - unique_together = ('name', 'type') - - def __unicode__(self): - return u'%s: %s' % (self.get_type_display(), self.name) - - def save(self, **kwargs): - if not self.slug: - self.slug = self.name#slugify(self.name) - super(Badge, self).save(**kwargs) - - def get_absolute_url(self): - return '%s%s/' % (reverse('badge', args=[self.id]), self.slug) - -class Award(models.Model): - """The awarding of a Badge to a User.""" - user = models.ForeignKey(User, related_name='award_user') - badge = models.ForeignKey(Badge, related_name='award_badge') - content_type = models.ForeignKey(ContentType) - object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') - awarded_at = models.DateTimeField(default=datetime.datetime.now) - notified = models.BooleanField(default=False) - - def __unicode__(self): - return u'[%s] is awarded a badge [%s] at %s' % (self.user.username, self.badge.name, self.awarded_at) - - class Meta: - db_table = u'award' - -class Repute(models.Model): - """The reputation histories for user""" - user = models.ForeignKey(User) - positive = models.SmallIntegerField(default=0) - negative = models.SmallIntegerField(default=0) - question = models.ForeignKey(Question) - reputed_at = models.DateTimeField(default=datetime.datetime.now) - reputation_type = models.SmallIntegerField(choices=TYPE_REPUTATION) - reputation = models.IntegerField(default=1) - objects = ReputeManager() - - def __unicode__(self): - return u'[%s]\' reputation changed at %s' % (self.user.username, self.reputed_at) - - class Meta: - db_table = u'repute' - -class Activity(models.Model): - """ - We keep some history data for user activities - """ - user = models.ForeignKey(User) - activity_type = models.SmallIntegerField(choices=TYPE_ACTIVITY) - active_at = models.DateTimeField(default=datetime.datetime.now) - content_type = models.ForeignKey(ContentType) - object_id = models.PositiveIntegerField() - content_object = generic.GenericForeignKey('content_type', 'object_id') - is_auditted = models.BooleanField(default=False) - - def __unicode__(self): - return u'[%s] was active at %s' % (self.user.username, self.active_at) - - class Meta: - db_table = u'activity' - -class Book(models.Model): - """ - Model for book info - """ - user = models.ForeignKey(User) - title = models.CharField(max_length=255) - short_name = models.CharField(max_length=255) - author = models.CharField(max_length=255) - price = models.DecimalField(max_digits=6, decimal_places=2) - pages = models.SmallIntegerField() - published_at = models.DateTimeField() - publication = models.CharField(max_length=255) - cover_img = models.CharField(max_length=255) - tagnames = models.CharField(max_length=125) - added_at = models.DateTimeField() - last_edited_at = models.DateTimeField() - questions = models.ManyToManyField(Question, related_name='book', db_table='book_question') - - def get_absolute_url(self): - return '%s' % reverse('book', args=[self.short_name]) - - def __unicode__(self): - return self.title - class Meta: - db_table = u'book' - -class BookAuthorInfo(models.Model): - """ - Model for book author info - """ - user = models.ForeignKey(User) - book = models.ForeignKey(Book) - blog_url = models.CharField(max_length=255) - added_at = models.DateTimeField() - last_edited_at = models.DateTimeField() - - class Meta: - db_table = u'book_author_info' - -class BookAuthorRss(models.Model): - """ - Model for book author blog rss - """ - user = models.ForeignKey(User) - book = models.ForeignKey(Book) - title = models.CharField(max_length=255) - url = models.CharField(max_length=255) - rss_created_at = models.DateTimeField() - added_at = models.DateTimeField() - - class Meta: - db_table = u'book_author_rss' - -# User extend properties -QUESTIONS_PER_PAGE_CHOICES = ( - (10, u'10'), - (30, u'30'), - (50, u'50'), -) - -User.add_to_class('reputation', models.PositiveIntegerField(default=1)) -User.add_to_class('gravatar', models.CharField(max_length=32)) -User.add_to_class('favorite_questions', - models.ManyToManyField(Question, through=FavoriteQuestion, - related_name='favorited_by')) -User.add_to_class('badges', models.ManyToManyField(Badge, through=Award, - related_name='awarded_to')) -User.add_to_class('gold', models.SmallIntegerField(default=0)) -User.add_to_class('silver', models.SmallIntegerField(default=0)) -User.add_to_class('bronze', models.SmallIntegerField(default=0)) -User.add_to_class('questions_per_page', - models.SmallIntegerField(choices=QUESTIONS_PER_PAGE_CHOICES, default=10)) -User.add_to_class('last_seen', - models.DateTimeField(default=datetime.datetime.now)) -User.add_to_class('real_name', models.CharField(max_length=100, blank=True)) -User.add_to_class('website', models.URLField(max_length=200, blank=True)) -User.add_to_class('location', models.CharField(max_length=100, blank=True)) -User.add_to_class('date_of_birth', models.DateField(null=True, blank=True)) -User.add_to_class('about', models.TextField(blank=True)) - -# custom signal -tags_updated = django.dispatch.Signal(providing_args=["question"]) -edit_question_or_answer = django.dispatch.Signal(providing_args=["instance", "modified_by"]) -delete_post_or_answer = django.dispatch.Signal(providing_args=["instance", "deleted_by"]) -mark_offensive = django.dispatch.Signal(providing_args=["instance", "mark_by"]) -user_updated = django.dispatch.Signal(providing_args=["instance", "updated_by"]) -def get_messages(self): - messages = [] - for m in self.message_set.all(): - messages.append(m.message) - return messages - -def delete_messages(self): - self.message_set.all().delete() - -def get_profile_url(self): - """Returns the URL for this User's profile.""" - return '%s%s/' % (reverse('user', args=[self.id]), self.username) -User.add_to_class('get_profile_url', get_profile_url) -User.add_to_class('get_messages', get_messages) -User.add_to_class('delete_messages', delete_messages) - -def calculate_gravatar_hash(instance, **kwargs): - """Calculates a User's gravatar hash from their email address.""" - if kwargs.get('raw', False): - return - instance.gravatar = hashlib.md5(instance.email).hexdigest() - -def record_ask_event(instance, created, **kwargs): - if created: - activity = Activity(user=instance.author, active_at=instance.added_at, content_object=instance, activity_type=TYPE_ACTIVITY_ASK_QUESTION) - activity.save() - -def record_answer_event(instance, created, **kwargs): - if created: - activity = Activity(user=instance.author, active_at=instance.added_at, content_object=instance, activity_type=TYPE_ACTIVITY_ANSWER) - activity.save() - -def record_comment_event(instance, created, **kwargs): - if created: - from django.contrib.contenttypes.models import ContentType - question_type = ContentType.objects.get_for_model(Question) - question_type_id = question_type.id - type = TYPE_ACTIVITY_COMMENT_QUESTION if instance.content_type_id == question_type_id else TYPE_ACTIVITY_COMMENT_ANSWER - activity = Activity(user=instance.user, active_at=instance.added_at, content_object=instance, activity_type=type) - activity.save() - -def record_revision_question_event(instance, created, **kwargs): - if created and instance.revision <> 1: - activity = Activity(user=instance.author, active_at=instance.revised_at, content_object=instance, activity_type=TYPE_ACTIVITY_UPDATE_QUESTION) - activity.save() - -def record_revision_answer_event(instance, created, **kwargs): - if created and instance.revision <> 1: - activity = Activity(user=instance.author, active_at=instance.revised_at, content_object=instance, activity_type=TYPE_ACTIVITY_UPDATE_ANSWER) - activity.save() - -def record_award_event(instance, created, **kwargs): - """ - After we awarded a badge to user, we need to record this activity and notify user. - We also recaculate awarded_count of this badge and user information. - """ - if created: - activity = Activity(user=instance.user, active_at=instance.awarded_at, content_object=instance, - activity_type=TYPE_ACTIVITY_PRIZE) - activity.save() - - instance.badge.awarded_count += 1 - instance.badge.save() - - if instance.badge.type == Badge.GOLD: - instance.user.gold += 1 - if instance.badge.type == Badge.SILVER: - instance.user.silver += 1 - if instance.badge.type == Badge.BRONZE: - instance.user.bronze += 1 - instance.user.save() - -def notify_award_message(instance, created, **kwargs): - """ - Notify users when they have been awarded badges by using Django message. - """ - if created: - user = instance.user - user.message_set.create(message=u"%s" % instance.badge.name) - -def record_answer_accepted(instance, created, **kwargs): - """ - when answer is accepted, we record this for question author - who accepted it. - """ - if not created and instance.accepted: - activity = Activity(user=instance.question.author, active_at=datetime.datetime.now(), \ - content_object=instance, activity_type=TYPE_ACTIVITY_MARK_ANSWER) - activity.save() - -def update_last_seen(instance, created, **kwargs): - """ - when user has activities, we update 'last_seen' time stamp for him - """ - user = instance.user - user.last_seen = datetime.datetime.now() - user.save() - -def record_vote(instance, created, **kwargs): - """ - when user have voted - """ - if created: - if instance.vote == 1: - vote_type = TYPE_ACTIVITY_VOTE_UP - else: - vote_type = TYPE_ACTIVITY_VOTE_DOWN - - activity = Activity(user=instance.user, active_at=instance.voted_at, content_object=instance, activity_type=vote_type) - activity.save() - -def record_cancel_vote(instance, **kwargs): - """ - when user canceled vote, the vote will be deleted. - """ - activity = Activity(user=instance.user, active_at=datetime.datetime.now(), content_object=instance, activity_type=TYPE_ACTIVITY_CANCEL_VOTE) - activity.save() - -def record_delete_question(instance, delete_by, **kwargs): - """ - when user deleted the question - """ - if instance.__class__ == "Question": - activity_type = TYPE_ACTIVITY_DELETE_QUESTION - else: - activity_type = TYPE_ACTIVITY_DELETE_ANSWER - - activity = Activity(user=delete_by, active_at=datetime.datetime.now(), content_object=instance, activity_type=activity_type) - activity.save() - -def record_mark_offensive(instance, mark_by, **kwargs): - activity = Activity(user=mark_by, active_at=datetime.datetime.now(), content_object=instance, activity_type=TYPE_ACTIVITY_MARK_OFFENSIVE) - activity.save() - -def record_update_tags(question, **kwargs): - """ - when user updated tags of the question - """ - activity = Activity(user=question.author, active_at=datetime.datetime.now(), content_object=question, activity_type=TYPE_ACTIVITY_UPDATE_TAGS) - activity.save() - -def record_favorite_question(instance, created, **kwargs): - """ - when user add the question in him favorite questions list. - """ - if created: - activity = Activity(user=instance.user, active_at=datetime.datetime.now(), content_object=instance, activity_type=TYPE_ACTIVITY_FAVORITE) - activity.save() - -def record_user_full_updated(instance, **kwargs): - activity = Activity(user=instance, active_at=datetime.datetime.now(), content_object=instance, activity_type=TYPE_ACTIVITY_USER_FULL_UPDATED) - activity.save() - -#signal for User modle save changes -pre_save.connect(calculate_gravatar_hash, sender=User) -post_save.connect(record_ask_event, sender=Question) -post_save.connect(record_answer_event, sender=Answer) -post_save.connect(record_comment_event, sender=Comment) -post_save.connect(record_revision_question_event, sender=QuestionRevision) -post_save.connect(record_revision_answer_event, sender=AnswerRevision) -post_save.connect(record_award_event, sender=Award) -post_save.connect(notify_award_message, sender=Award) -post_save.connect(record_answer_accepted, sender=Answer) -post_save.connect(update_last_seen, sender=Activity) -post_save.connect(record_vote, sender=Vote) -post_delete.connect(record_cancel_vote, sender=Vote) -delete_post_or_answer.connect(record_delete_question, sender=Question) -delete_post_or_answer.connect(record_delete_question, sender=Answer) -mark_offensive.connect(record_mark_offensive, sender=Question) -mark_offensive.connect(record_mark_offensive, sender=Answer) -tags_updated.connect(record_update_tags, sender=Question) -post_save.connect(record_favorite_question, sender=FavoriteQuestion) -user_updated.connect(record_user_full_updated, sender=User) diff --git a/forum/templatetags/__init__.py b/forum/templatetags/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/forum/templatetags/extra_filters.py b/forum/templatetags/extra_filters.py deleted file mode 100644 index 744fa762..00000000 --- a/forum/templatetags/extra_filters.py +++ /dev/null @@ -1,83 +0,0 @@ -锘縡rom django import template -from forum import auth - -register = template.Library() - -@register.filter -def can_vote_up(user): - return auth.can_vote_up(user) - -@register.filter -def can_flag_offensive(user): - return auth.can_flag_offensive(user) - -@register.filter -def can_add_comments(user): - return auth.can_add_comments(user) - -@register.filter -def can_vote_down(user): - return auth.can_vote_down(user) - -@register.filter -def can_retag_questions(user): - return auth.can_retag_questions(user) - -@register.filter -def can_edit_post(user, post): - return auth.can_edit_post(user, post) - -@register.filter -def can_delete_comment(user, comment): - return auth.can_delete_comment(user, comment) - -@register.filter -def can_view_offensive_flags(user): - return auth.can_view_offensive_flags(user) - -@register.filter -def can_close_question(user, question): - return auth.can_close_question(user, question) - -@register.filter -def can_lock_posts(user): - return auth.can_lock_posts(user) - -@register.filter -def can_accept_answer(user, question, answer): - return auth.can_accept_answer(user, question, answer) - -@register.filter -def can_reopen_question(user, question): - return auth.can_reopen_question(user, question) - -@register.filter -def can_delete_post(user, post): - return auth.can_delete_post(user, post) - -@register.filter -def can_view_user_edit(request_user, target_user): - return auth.can_view_user_edit(request_user, target_user) - -@register.filter -def can_view_user_votes(request_user, target_user): - return auth.can_view_user_votes(request_user, target_user) - -@register.filter -def can_view_user_preferences(request_user, target_user): - return auth.can_view_user_preferences(request_user, target_user) - -@register.filter -def is_user_self(request_user, target_user): - return auth.is_user_self(request_user, target_user) - -@register.filter -def cnprog_intword(number): - try: - if 1000 <= number < 10000: - string = str(number)[0:1] - return "%sk" % string - else: - return number - except: - return number \ No newline at end of file diff --git a/forum/templatetags/extra_tags.py b/forum/templatetags/extra_tags.py deleted file mode 100644 index de853135..00000000 --- a/forum/templatetags/extra_tags.py +++ /dev/null @@ -1,240 +0,0 @@ -import time -import datetime -import math -import re -import logging -from django import template -from django.utils.encoding import smart_unicode -from django.utils.safestring import mark_safe -from django.utils.timesince import timesince -from forum.const import * -from django.utils.translation import ugettext as _ - -register = template.Library() - -GRAVATAR_TEMPLATE = ('') - -@register.simple_tag -def gravatar(user, size): - """ - Creates an ```` for a user's Gravatar with a given size. - - This tag can accept a User object, or a dict containing the - appropriate values. - """ - try: - gravatar = user['gravatar'] - except (TypeError, AttributeError, KeyError): - gravatar = user.gravatar - return mark_safe(GRAVATAR_TEMPLATE % { - 'size': size, - 'gravatar_hash': gravatar, - }) - -MAX_FONTSIZE = 18 -MIN_FONTSIZE = 12 -@register.simple_tag -def tag_font_size(max_size, min_size, current_size): - """ - do a logarithmic mapping calcuation for a proper size for tagging cloud - Algorithm from http://blogs.dekoh.com/dev/2007/10/29/choosing-a-good-font-size-variation-algorithm-for-your-tag-cloud/ - """ - #avoid invalid calculation - if current_size == 0: - current_size = 1 - try: - weight = (math.log10(current_size) - math.log10(min_size)) / (math.log10(max_size) - math.log10(min_size)) - except: - weight = 0 - return MIN_FONTSIZE + round((MAX_FONTSIZE - MIN_FONTSIZE) * weight) - - -LEADING_PAGE_RANGE_DISPLAYED = TRAILING_PAGE_RANGE_DISPLAYED = 5 -LEADING_PAGE_RANGE = TRAILING_PAGE_RANGE = 4 -NUM_PAGES_OUTSIDE_RANGE = 1 -ADJACENT_PAGES = 2 -@register.inclusion_tag("paginator.html") -def cnprog_paginator(context): - """ - custom paginator tag - Inspired from http://blog.localkinegrinds.com/2007/09/06/digg-style-pagination-in-django/ - """ - if (context["is_paginated"]): - " Initialize variables " - in_leading_range = in_trailing_range = False - pages_outside_leading_range = pages_outside_trailing_range = range(0) - - if (context["pages"] <= LEADING_PAGE_RANGE_DISPLAYED): - in_leading_range = in_trailing_range = True - page_numbers = [n for n in range(1, context["pages"] + 1) if n > 0 and n <= context["pages"]] - elif (context["page"] <= LEADING_PAGE_RANGE): - in_leading_range = True - page_numbers = [n for n in range(1, LEADING_PAGE_RANGE_DISPLAYED + 1) if n > 0 and n <= context["pages"]] - pages_outside_leading_range = [n + context["pages"] for n in range(0, -NUM_PAGES_OUTSIDE_RANGE, -1)] - elif (context["page"] > context["pages"] - TRAILING_PAGE_RANGE): - in_trailing_range = True - page_numbers = [n for n in range(context["pages"] - TRAILING_PAGE_RANGE_DISPLAYED + 1, context["pages"] + 1) if n > 0 and n <= context["pages"]] - pages_outside_trailing_range = [n + 1 for n in range(0, NUM_PAGES_OUTSIDE_RANGE)] - else: - page_numbers = [n for n in range(context["page"] - ADJACENT_PAGES, context["page"] + ADJACENT_PAGES + 1) if n > 0 and n <= context["pages"]] - pages_outside_leading_range = [n + context["pages"] for n in range(0, -NUM_PAGES_OUTSIDE_RANGE, -1)] - pages_outside_trailing_range = [n + 1 for n in range(0, NUM_PAGES_OUTSIDE_RANGE)] - - extend_url = context.get('extend_url', '') - return { - "base_url": context["base_url"], - "is_paginated": context["is_paginated"], - "previous": context["previous"], - "has_previous": context["has_previous"], - "next": context["next"], - "has_next": context["has_next"], - "page": context["page"], - "pages": context["pages"], - "page_numbers": page_numbers, - "in_leading_range" : in_leading_range, - "in_trailing_range" : in_trailing_range, - "pages_outside_leading_range": pages_outside_leading_range, - "pages_outside_trailing_range": pages_outside_trailing_range, - "extend_url" : extend_url - } - -@register.inclusion_tag("pagesize.html") -def cnprog_pagesize(context): - """ - display the pagesize selection boxes for paginator - """ - if (context["is_paginated"]): - return { - "base_url": context["base_url"], - "pagesize" : context["pagesize"], - "is_paginated": context["is_paginated"] - } - -@register.simple_tag -def get_score_badge(user): - BADGE_TEMPLATE = '%(reputation)s' - if user.gold > 0 : - BADGE_TEMPLATE = '%s%s' % (BADGE_TEMPLATE, '' - '' - '%(gold)s' - '') - if user.silver > 0: - BADGE_TEMPLATE = '%s%s' % (BADGE_TEMPLATE, '' - '' - '%(silver)s' - '') - if user.bronze > 0: - BADGE_TEMPLATE = '%s%s' % (BADGE_TEMPLATE, '' - '' - '%(bronze)s' - '') - BADGE_TEMPLATE = smart_unicode(BADGE_TEMPLATE, encoding='utf-8', strings_only=False, errors='strict') - return mark_safe(BADGE_TEMPLATE % { - 'reputation' : user.reputation, - 'gold' : user.gold, - 'silver' : user.silver, - 'bronze' : user.bronze, - 'badgesword' : _('badges'), - 'reputationword' : _('reputation points'), - }) - -@register.simple_tag -def get_score_badge_by_details(rep, gold, silver, bronze): - BADGE_TEMPLATE = '%(reputation)s' - if gold > 0 : - BADGE_TEMPLATE = '%s%s' % (BADGE_TEMPLATE, '' - '' - '%(gold)s' - '') - if silver > 0: - BADGE_TEMPLATE = '%s%s' % (BADGE_TEMPLATE, '' - '' - '%(silver)s' - '') - if bronze > 0: - BADGE_TEMPLATE = '%s%s' % (BADGE_TEMPLATE, '' - '' - '%(bronze)s' - '') - BADGE_TEMPLATE = smart_unicode(BADGE_TEMPLATE, encoding='utf-8', strings_only=False, errors='strict') - return mark_safe(BADGE_TEMPLATE % { - 'reputation' : rep, - 'gold' : gold, - 'silver' : silver, - 'bronze' : bronze, - 'repword' : _('reputation points'), - 'badgeword' : _('badges'), - }) - -@register.simple_tag -def get_user_vote_image(dic, key, arrow): - if dic.has_key(key): - if int(dic[key]) == int(arrow): - return '-on' - return '' - -@register.simple_tag -def get_age(birthday): - current_time = datetime.datetime(*time.localtime()[0:6]) - year = birthday.year - month = birthday.month - day = birthday.day - diff = current_time - datetime.datetime(year,month,day,0,0,0) - return diff.days / 365 - -@register.simple_tag -def get_total_count(up_count, down_count): - return up_count + down_count - -@register.simple_tag -def format_number(value): - strValue = str(value) - if len(strValue) <= 3: - return strValue - result = '' - first = '' - pattern = re.compile('(-?\d+)(\d{3})') - m = re.match(pattern, strValue) - while m != None: - first = m.group(1) - second = m.group(2) - result = ',' + second + result - strValue = first + ',' + second - m = re.match(pattern, strValue) - return first + result - -@register.simple_tag -def convert2tagname_list(question): - question['tagnames'] = [name for name in question['tagnames'].split(u' ')] - return '' - -@register.simple_tag -def diff_date(date, limen=2): - current_time = datetime.datetime(*time.localtime()[0:6]) - diff = current_time - date - diff_days = diff.days - if diff_days > limen: - return date - else: - return timesince(date) + _(' ago') - -@register.simple_tag -def get_latest_changed_timestamp(): - try: - from time import localtime, strftime - from os import path - from django.conf import settings - root = settings.SITE_SRC_ROOT - dir = ( - root, - '%s/forum' % root, - '%s/templates' % root, - ) - stamp = (path.getmtime(d) for d in dir) - latest = max(stamp) - timestr = strftime("%H:%M %b-%d-%Y %Z", localtime(latest)) - except: - timestr = '' - return timestr diff --git a/forum/user.py b/forum/user.py deleted file mode 100644 index 13e9be30..00000000 --- a/forum/user.py +++ /dev/null @@ -1,74 +0,0 @@ -from django.utils.translation import ugettext as _ -class UserView: - def __init__(self, id, tab_title, tab_description, page_title, view_name, template_file, data_size=0): - self.id = id - self.tab_title = tab_title - self.tab_description = tab_description - self.page_title = page_title - self.view_name = view_name - self.template_file = template_file - self.data_size = data_size - - -USER_TEMPLATE_VIEWS = ( - UserView( - id = 'stats', - tab_title = _('overview'), - tab_description = _('user profile'), - page_title = _('user profile overview'), - view_name = 'user_stats', - template_file = 'user_stats.html' - ), - UserView( - id = 'recent', - tab_title = _('recent activity'), - tab_description = _('recent user activity'), - page_title = _('profile - recent activity'), - view_name = 'user_recent', - template_file = 'user_recent.html', - data_size = 50 - ), - UserView( - id = 'responses', - tab_title = _('responses'), - tab_description = _('comments and answers to others questions'), - page_title = _('profile - responses'), - view_name = 'user_responses', - template_file = 'user_responses.html', - data_size = 50 - ), - UserView( - id = 'reputation', - tab_title = _('reputation'), - tab_description = _('user reputation in the community'), - page_title = _('profile - user reputation'), - view_name = 'user_reputation', - template_file = 'user_reputation.html' - ), - UserView( - id = 'favorites', - tab_title = _('favorite questions'), - tab_description = _('users favorite questions'), - page_title = _('profile - favorite questions'), - view_name = 'user_favorites', - template_file = 'user_favorites.html', - data_size = 50 - ), - UserView( - id = 'votes', - tab_title = _('casted votes'), - tab_description = _('user vote record'), - page_title = _('profile - votes'), - view_name = 'user_votes', - template_file = 'user_votes.html', - data_size = 50 - ), - UserView( - id = 'preferences', - tab_title = _('preferences'), - tab_description = _('user preference settings'), - page_title = _('profile - user preferences'), - view_name = 'user_preferences', - template_file = 'user_preferences.html' - ) -) diff --git a/forum/views.py b/forum/views.py deleted file mode 100644 index 25574e0b..00000000 --- a/forum/views.py +++ /dev/null @@ -1,1962 +0,0 @@ -# encoding:utf-8 -import os.path -import time, datetime, calendar, random -import logging -from urllib import quote, unquote -from django.conf import settings -from django.core.files.storage import default_storage -from django.shortcuts import render_to_response, get_object_or_404 -from django.contrib.auth.decorators import login_required -from django.http import HttpResponseRedirect, HttpResponse,Http404 -from django.core.paginator import Paginator, EmptyPage, InvalidPage -from django.template import RequestContext -from django.utils.html import * -from django.utils import simplejson -from django.core import serializers -from django.db import transaction -from django.contrib.contenttypes.models import ContentType -from django.utils.translation import ugettext as _ - -from utils.html import sanitize_html -from markdown2 import Markdown -#from lxml.html.diff import htmldiff -from forum.diff import textDiff as htmldiff -from forum.forms import * -from forum.models import * -from forum.auth import * -from forum.const import * -from forum.user import * -from forum import auth - -# used in index page -INDEX_PAGE_SIZE = 20 -INDEX_AWARD_SIZE = 15 -INDEX_TAGS_SIZE = 100 -# used in tags list -DEFAULT_PAGE_SIZE = 60 -# used in questions -QUESTIONS_PAGE_SIZE = 10 -# used in users -USERS_PAGE_SIZE = 35 -# used in answers -ANSWERS_PAGE_SIZE = 10 -markdowner = Markdown(html4tags=True) -question_type = ContentType.objects.get_for_model(Question) -answer_type = ContentType.objects.get_for_model(Answer) -comment_type = ContentType.objects.get_for_model(Comment) -question_revision_type = ContentType.objects.get_for_model(QuestionRevision) -answer_revision_type = ContentType.objects.get_for_model(AnswerRevision) -repute_type =ContentType.objects.get_for_model(Repute) -question_type_id = question_type.id -answer_type_id = answer_type.id -comment_type_id = comment_type.id -question_revision_type_id = question_revision_type.id -answer_revision_type_id = answer_revision_type.id -repute_type_id = repute_type.id -def _get_tags_cache_json(): - tags = Tag.objects.filter(deleted=False).all() - tags_list = [] - for tag in tags: - dic = {'n': tag.name, 'c': tag.used_count } - tags_list.append(dic) - tags = simplejson.dumps(tags_list) - return tags - -def index(request): - view_id = request.GET.get('sort', None) - view_dic = { - "latest":"-last_activity_at", - "hottest":"-answer_count", - "mostvoted":"-score", - "trans": "-last_activity_at" - } - try: - orderby = view_dic[view_id] - except KeyError: - view_id = "latest" - orderby = "-last_activity_at" - # group questions by author_id of 28,29 - if view_id == 'trans': - questions = Question.objects.filter(deleted=False, author__id__in=[28,29]).order_by(orderby)[:INDEX_PAGE_SIZE] - else: - questions = Question.objects.filter(deleted=False).order_by(orderby)[:INDEX_PAGE_SIZE] - # RISK - inner join queries - questions = questions.select_related(); - tags = Tag.objects.all().filter(deleted=False).exclude(used_count=0).order_by("-id")[:INDEX_TAGS_SIZE] - - awards = Award.objects.extra( - select={'badge_id': 'badge.id', 'badge_name':'badge.name', - 'badge_description': 'badge.description', 'badge_type': 'badge.type', - 'user_id': 'auth_user.id', 'user_name': 'auth_user.username' - }, - tables=['award', 'badge', 'auth_user'], - order_by=['-awarded_at'], - where=['auth_user.id=award.user_id AND badge_id=badge.id'], - ).values('badge_id', 'badge_name', 'badge_description', 'badge_type', 'user_id', 'user_name') - - class testvar: - content = 'haha' - - return render_to_response('index.html', { - "questions" : questions, - 'testvar':testvar, - "tab_id" : view_id, - "tags" : tags, - "awards" : awards[:INDEX_AWARD_SIZE], - }, context_instance=RequestContext(request)) - -def about(request): - return render_to_response('about.html', context_instance=RequestContext(request)) - -def faq(request): - return render_to_response('faq.html', context_instance=RequestContext(request)) - -def privacy(request): - return render_to_response('privacy.html', context_instance=RequestContext(request)) - -def unanswered(request): - return questions(request, unanswered=True) - -def questions(request, tagname=None, unanswered=False): - """ - List of Questions, Tagged questions, and Unanswered questions. - """ - # template file - # "questions.html" or "unanswered.html" - template_file = "questions.html" - # Set flag to False by default. If it is equal to True, then need to be saved. - pagesize_changed = False - # get pagesize from session, if failed then get default value - user_page_size = request.session.get("pagesize", QUESTIONS_PAGE_SIZE) - # set pagesize equal to logon user specified value in database - if request.user.is_authenticated() and request.user.questions_per_page > 0: - user_page_size = request.user.questions_per_page - - try: - page = int(request.GET.get('page', '1')) - # get new pagesize from UI selection - pagesize = int(request.GET.get('pagesize', user_page_size)) - if pagesize <> user_page_size: - pagesize_changed = True - - except ValueError: - page = 1 - pagesize = user_page_size - - # save this pagesize to user database - if pagesize_changed: - request.session["pagesize"] = pagesize - if request.user.is_authenticated(): - user = request.user - user.questions_per_page = pagesize - user.save() - - view_id = request.GET.get('sort', None) - view_dic = {"latest":"-added_at", "active":"-last_activity_at", "hottest":"-answer_count", "mostvoted":"-score" } - try: - orderby = view_dic[view_id] - except KeyError: - view_id = "latest" - orderby = "-added_at" - - # check if request is from tagged questions - if tagname is not None: - #print datetime.datetime.now() - objects = Question.objects.filter(deleted=False, tags__name = unquote(tagname)).order_by(orderby) - #print datetime.datetime.now() - elif unanswered: - #check if request is from unanswered questions - template_file = "unanswered.html" - objects = Question.objects.filter(deleted=False, answer_count=0).order_by(orderby) - else: - objects = Question.objects.filter(deleted=False).order_by(orderby) - - # RISK - inner join queries - objects = objects.select_related(); - objects_list = Paginator(objects, pagesize) - questions = objects_list.page(page) - - # Get related tags from this page objects - related_tags = [] - for question in questions.object_list: - tags = list(question.tags.all()) - for tag in tags: - if tag not in related_tags: - related_tags.append(tag) - - return render_to_response(template_file, { - "questions" : questions, - "tab_id" : view_id, - "questions_count" : objects_list.count, - "tags" : related_tags, - "searchtag" : tagname, - "is_unanswered" : unanswered, - "context" : { - 'is_paginated' : True, - 'pages': objects_list.num_pages, - 'page': page, - 'has_previous': questions.has_previous(), - 'has_next': questions.has_next(), - 'previous': questions.previous_page_number(), - 'next': questions.next_page_number(), - 'base_url' : request.path + '?sort=%s&' % view_id, - 'pagesize' : pagesize - }}, context_instance=RequestContext(request)) - -#TODO: allow anynomus user to ask question by providing email and username. -@login_required -def ask(request): - if request.method == "POST": - form = AskForm(request.POST) - if form.is_valid(): - added_at = datetime.datetime.now() - html = sanitize_html(markdowner.convert(form.cleaned_data['text'])) - question = Question( - title = strip_tags(form.cleaned_data['title']), - author = request.user, - added_at = added_at, - last_activity_at = added_at, - last_activity_by = request.user, - wiki = form.cleaned_data['wiki'], - tagnames = form.cleaned_data['tags'].strip(), - html = html, - summary = strip_tags(html)[:120] - ) - if question.wiki: - question.last_edited_by = question.author - question.last_edited_at = added_at - question.wikified_at = added_at - - question.save() - - # create the first revision - QuestionRevision.objects.create( - question = question, - revision = 1, - title = question.title, - author = request.user, - revised_at = added_at, - tagnames = question.tagnames, - summary = CONST['default_version'], - text = form.cleaned_data['text'] - ) - - return HttpResponseRedirect(question.get_absolute_url()) - - else: - form = AskForm() - - tags = _get_tags_cache_json() - return render_to_response('ask.html', { - 'form' : form, - 'tags' : tags, - }, context_instance=RequestContext(request)) - -def question(request, id): - try: - page = int(request.GET.get('page', '1')) - except ValueError: - page = 1 - view_id = request.GET.get('sort', 'votes') - view_dic = {"latest":"-added_at", "oldest":"added_at", "votes":"-score" } - try: - orderby = view_dic[view_id] - except KeyError: - view_id = "votes" - orderby = "-score" - - question = get_object_or_404(Question, id=id) - if question.deleted and not can_view_deleted_post(request.user, question): - raise Http404 - answer_form = AnswerForm(question) - answers = Answer.objects.get_answers_from_question(question, request.user) - answers = answers.select_related(depth=1) - - favorited = question.has_favorite_by_user(request.user) - question_vote = question.votes.select_related().filter(user=request.user) - if question_vote is not None and question_vote.count() > 0: - question_vote = question_vote[0] - - user_answer_votes = {} - for answer in answers: - vote = answer.get_user_vote(request.user) - if vote is not None and not user_answer_votes.has_key(answer.id): - vote_value = -1 - if vote.is_upvote(): - vote_value = 1 - user_answer_votes[answer.id] = vote_value - - - if answers is not None: - answers = answers.order_by("-accepted", orderby) - objects_list = Paginator(answers, ANSWERS_PAGE_SIZE) - page_objects = objects_list.page(page) - # update view count - Question.objects.update_view_count(question) - return render_to_response('question.html', { - "question" : question, - "question_vote" : question_vote, - "question_comment_count":question.comments.count(), - "answer" : answer_form, - "answers" : page_objects.object_list, - "user_answer_votes": user_answer_votes, - "tags" : question.tags.all(), - "tab_id" : view_id, - "favorited" : favorited, - "similar_questions" : Question.objects.get_similar_questions(question), - "context" : { - 'is_paginated' : True, - 'pages': objects_list.num_pages, - 'page': page, - 'has_previous': page_objects.has_previous(), - 'has_next': page_objects.has_next(), - 'previous': page_objects.previous_page_number(), - 'next': page_objects.next_page_number(), - 'base_url' : request.path + '?sort=%s&' % view_id, - 'extend_url' : "#sort-top" - } - }, context_instance=RequestContext(request)) - -@login_required -def close(request, id): - question = get_object_or_404(Question, id=id) - if not can_close_question(request.user, question): - return HttpResponse('Permission denied.') - if request.method == 'POST': - form = CloseForm(request.POST) - if form.is_valid(): - reason = form.cleaned_data['reason'] - question.closed = True - question.closed_by = request.user - question.closed_at = datetime.datetime.now() - question.close_reason = reason - question.save() - return HttpResponseRedirect(question.get_absolute_url()) - else: - form = CloseForm() - return render_to_response('close.html', { - 'form' : form, - 'question' : question, - }, context_instance=RequestContext(request)) - -@login_required -def reopen(request, id): - question = get_object_or_404(Question, id=id) - # open question - if not can_reopen_question(request.user, question): - return HttpResponse('Permission denied.') - if request.method == 'POST' : - Question.objects.filter(id=question.id).update(closed=False, - closed_by=None, closed_at=None, close_reason=None) - return HttpResponseRedirect(question.get_absolute_url()) - else: - return render_to_response('reopen.html', { - 'question' : question, - }, context_instance=RequestContext(request)) - -@login_required -def edit_question(request, id): - question = get_object_or_404(Question, id=id) - if question.deleted and not can_view_deleted_post(request.user, question): - raise Http404 - if can_edit_post(request.user, question): - return _edit_question(request, question) - elif can_retag_questions(request.user): - return _retag_question(request, question) - else: - raise Http404 - -def _retag_question(request, question): - if request.method == 'POST': - form = RetagQuestionForm(question, request.POST) - if form.is_valid(): - if form.has_changed(): - latest_revision = question.get_latest_revision() - retagged_at = datetime.datetime.now() - # Update the Question itself - Question.objects.filter(id=question.id).update( - tagnames = form.cleaned_data['tags'], - last_edited_at = retagged_at, - last_edited_by = request.user, - last_activity_at = retagged_at, - last_activity_by = request.user - ) - # Update the Question's tag associations - tags_updated = Question.objects.update_tags(question, - form.cleaned_data['tags'], request.user) - # Create a new revision - QuestionRevision.objects.create( - question = question, - title = latest_revision.title, - author = request.user, - revised_at = retagged_at, - tagnames = form.cleaned_data['tags'], - summary = CONST['retagged'], - text = latest_revision.text - ) - # send tags updated singal - tags_updated.send(sender=question.__class__, question=question) - - return HttpResponseRedirect(question.get_absolute_url()) - else: - form = RetagQuestionForm(question) - return render_to_response('question_retag.html', { - 'question': question, - 'form' : form, - 'tags' : _get_tags_cache_json(), - }, context_instance=RequestContext(request)) - - -def _edit_question(request, question): - latest_revision = question.get_latest_revision() - revision_form = None - if request.method == 'POST': - if 'select_revision' in request.POST: - # user has changed revistion number - revision_form = RevisionForm(question, latest_revision, request.POST) - if revision_form.is_valid(): - # Replace with those from the selected revision - form = EditQuestionForm(question, - QuestionRevision.objects.get(question=question, - revision=revision_form.cleaned_data['revision'])) - else: - form = EditQuestionForm(question, latest_revision, request.POST) - else: - # Always check modifications against the latest revision - form = EditQuestionForm(question, latest_revision, request.POST) - if form.is_valid(): - html = sanitize_html(markdowner.convert(form.cleaned_data['text'])) - if form.has_changed(): - edited_at = datetime.datetime.now() - tags_changed = (latest_revision.tagnames != - form.cleaned_data['tags']) - tags_updated = False - # Update the Question itself - updated_fields = { - 'title': form.cleaned_data['title'], - 'last_edited_at': edited_at, - 'last_edited_by': request.user, - 'last_activity_at': edited_at, - 'last_activity_by': request.user, - 'tagnames': form.cleaned_data['tags'], - 'summary': strip_tags(html)[:120], - 'html': html, - } - - # only save when it's checked - # because wiki doesn't allow to be edited if last version has been enabled already - # and we make sure this in forms. - if ('wiki' in form.cleaned_data and - form.cleaned_data['wiki']): - updated_fields['wiki'] = True - updated_fields['wikified_at'] = edited_at - - Question.objects.filter( - id=question.id).update(**updated_fields) - # Update the Question's tag associations - if tags_changed: - tags_updated = Question.objects.update_tags( - question, form.cleaned_data['tags'], request.user) - # Create a new revision - revision = QuestionRevision( - question = question, - title = form.cleaned_data['title'], - author = request.user, - revised_at = edited_at, - tagnames = form.cleaned_data['tags'], - text = form.cleaned_data['text'], - ) - if form.cleaned_data['summary']: - revision.summary = form.cleaned_data['summary'] - else: - revision.summary = 'No.%s Revision' % latest_revision.revision - revision.save() - - return HttpResponseRedirect(question.get_absolute_url()) - else: - - revision_form = RevisionForm(question, latest_revision) - form = EditQuestionForm(question, latest_revision) - return render_to_response('question_edit.html', { - 'question': question, - 'revision_form': revision_form, - 'form' : form, - 'tags' : _get_tags_cache_json() - }, context_instance=RequestContext(request)) - - -@login_required -def edit_answer(request, id): - answer = get_object_or_404(Answer, id=id) - if answer.deleted and not can_view_deleted_post(request.user, answer): - raise Http404 - elif not can_edit_post(request.user, answer): - raise Http404 - else: - latest_revision = answer.get_latest_revision() - if request.method == "POST": - if 'select_revision' in request.POST: - # user has changed revistion number - revision_form = RevisionForm(answer, latest_revision, request.POST) - if revision_form.is_valid(): - # Replace with those from the selected revision - form = EditAnswerForm(answer, - AnswerRevision.objects.get(answer=answer, - revision=revision_form.cleaned_data['revision'])) - else: - form = EditAnswerForm(answer, latest_revision, request.POST) - else: - form = EditAnswerForm(answer, latest_revision, request.POST) - if form.is_valid(): - html = sanitize_html(markdowner.convert(form.cleaned_data['text'])) - if form.has_changed(): - edited_at = datetime.datetime.now() - updated_fields = { - 'last_edited_at': edited_at, - 'last_edited_by': request.user, - 'html': html, - } - Answer.objects.filter(id=answer.id).update(**updated_fields) - - revision = AnswerRevision( - answer = answer, - author = request.user, - revised_at = edited_at, - text = form.cleaned_data['text'] - ) - - if form.cleaned_data['summary']: - revision.summary = form.cleaned_data['summary'] - else: - revision.summary = 'No.%s Revision' % latest_revision.revision - revision.save() - - answer.question.last_activity_at = edited_at - answer.question.last_activity_by = request.user - answer.question.save() - - return HttpResponseRedirect(answer.get_absolute_url()) - else: - revision_form = RevisionForm(answer, latest_revision) - form = EditAnswerForm(answer, latest_revision) - return render_to_response('answer_edit.html', { - 'answer': answer, - 'revision_form': revision_form, - 'form' : form, - }, context_instance=RequestContext(request)) - -QUESTION_REVISION_TEMPLATE = ('

%(title)s

\n' - '
%(html)s
\n' - '
%(tags)s
') -def question_revisions(request, id): - post = get_object_or_404(Question, id=id) - revisions = list(post.revisions.all()) - for i, revision in enumerate(revisions): - revision.html = QUESTION_REVISION_TEMPLATE % { - 'title': revision.title, - 'html': sanitize_html(markdowner.convert(revision.text)), - 'tags': ' '.join(['' % tag - for tag in revision.tagnames.split(' ')]), - } - if i > 0: - revisions[i - 1].diff = htmldiff(revision.html, - revisions[i - 1].html) - else: - revisions[i - 1].diff = QUESTION_REVISION_TEMPLATE % { - 'title': revisions[0].title, - 'html': sanitize_html(markdowner.convert(revisions[0].text)), - 'tags': ' '.join(['' % tag - for tag in revisions[0].tagnames.split(' ')]), - } - revisions[i - 1].summary = None - return render_to_response('revisions_question.html', { - 'post': post, - 'revisions': revisions, - }, context_instance=RequestContext(request)) - -ANSWER_REVISION_TEMPLATE = ('
%(html)s
') -def answer_revisions(request, id): - post = get_object_or_404(Answer, id=id) - revisions = list(post.revisions.all()) - for i, revision in enumerate(revisions): - revision.html = ANSWER_REVISION_TEMPLATE % { - 'html': sanitize_html(markdowner.convert(revision.text)) - } - if i > 0: - revisions[i - 1].diff = htmldiff(revision.html, - revisions[i - 1].html) - else: - revisions[i - 1].diff = revisions[i-1].text - revisions[i - 1].summary = None - return render_to_response('revisions_answer.html', { - 'post': post, - 'revisions': revisions, - }, context_instance=RequestContext(request)) - -#TODO: allow anynomus -@login_required -def answer(request, id): - question = get_object_or_404(Question, id=id) - if request.method == "POST": - form = AnswerForm(question, request.POST) - if form.is_valid(): - update_time = datetime.datetime.now() - answer = Answer( - question = question, - author = request.user, - added_at = update_time, - wiki = form.cleaned_data['wiki'], - html = sanitize_html(markdowner.convert(form.cleaned_data['text'])), - ) - if answer.wiki: - answer.last_edited_by = answer.author - answer.last_edited_at = update_time - answer.wikified_at = update_time - - answer.save() - Question.objects.update_answer_count(question) - - question = get_object_or_404(Question, id=id) - question.last_activity_at = update_time - question.last_activity_by = request.user - question.save() - - AnswerRevision.objects.create( - answer = answer, - revision = 1, - author = request.user, - revised_at = update_time, - summary = CONST['default_version'], - text = form.cleaned_data['text'] - ) - - return HttpResponseRedirect(question.get_absolute_url()) - -def tags(request): - stag = "" - is_paginated = True - sortby = request.GET.get('sort', 'used') - try: - page = int(request.GET.get('page', '1')) - except ValueError: - page = 1 - - if request.method == "GET": - stag = request.GET.get("q", "").strip() - if stag is not None: - objects_list = Paginator(Tag.objects.filter(deleted=False).exclude(used_count=0).extra(where=['name like %s'], params=['%' + stag + '%']), DEFAULT_PAGE_SIZE) - else: - if sortby == "name": - objects_list = Paginator(Tag.objects.all().filter(deleted=False).exclude(used_count=0).order_by("name"), DEFAULT_PAGE_SIZE) - else: - objects_list = Paginator(Tag.objects.all().filter(deleted=False).exclude(used_count=0).order_by("-used_count"), DEFAULT_PAGE_SIZE) - - try: - tags = objects_list.page(page) - except (EmptyPage, InvalidPage): - tags = objects_list.page(objects_list.num_pages) - - return render_to_response('tags.html', { - "tags" : tags, - "stag" : stag, - "tab_id" : sortby, - "keywords" : stag, - "context" : { - 'is_paginated' : is_paginated, - 'pages': objects_list.num_pages, - 'page': page, - 'has_previous': tags.has_previous(), - 'has_next': tags.has_next(), - 'previous': tags.previous_page_number(), - 'next': tags.next_page_number(), - 'base_url' : '/tags/?sort=%s&' % sortby - } - - }, context_instance=RequestContext(request)) - -def tag(request, tag): - return questions(request, tagname=tag) - -def vote(request, id): - """ - vote_type: - acceptAnswer : 0, - questionUpVote : 1, - questionDownVote : 2, - favorite : 4, - answerUpVote: 5, - answerDownVote:6, - offensiveQuestion : 7, - offensiveAnswer:8, - removeQuestion: 9, - removeAnswer:10 - - accept answer code: - response_data['allowed'] = -1, Accept his own answer 0, no allowed - Anonymous 1, Allowed - by default - response_data['success'] = 0, failed 1, Success - by default - response_data['status'] = 0, By default 1, Answer has been accepted already(Cancel) - - vote code: - allowed = -3, Don't have enough votes left - -2, Don't have enough reputation score - -1, Vote his own post - 0, no allowed - Anonymous - 1, Allowed - by default - status = 0, By default - 1, Cancel - 2, Vote is too old to be canceled - - offensive code: - allowed = -3, Don't have enough flags left - -2, Don't have enough reputation score to do this - 0, not allowed - 1, allowed - status = 0, by default - 1, can't do it again - """ - response_data = { - "allowed": 1, - "success": 1, - "status" : 0, - "count" : 0, - "message" : '' - } - - def can_vote(vote_score, user): - if vote_score == 1: - return can_vote_up(request.user) - else: - return can_vote_down(request.user) - - try: - if not request.user.is_authenticated(): - response_data['allowed'] = 0 - response_data['success'] = 0 - - elif request.is_ajax(): - question = get_object_or_404(Question, id=id) - vote_type = request.POST.get('type') - - #accept answer - if vote_type == '0': - answer_id = request.POST.get('postId') - answer = get_object_or_404(Answer, id=answer_id) - # make sure question author is current user - if question.author == request.user: - # answer user who is also question author is not allow to accept answer - if answer.author == question.author: - response_data['success'] = 0 - response_data['allowed'] = -1 - # check if answer has been accepted already - elif answer.accepted: - onAnswerAcceptCanceled(answer, request.user) - response_data['status'] = 1 - else: - # set other answers in this question not accepted first - for answer_of_question in Answer.objects.get_answers_from_question(question, request.user): - if answer_of_question != answer and answer_of_question.accepted: - onAnswerAcceptCanceled(answer_of_question, request.user) - - #make sure retrieve data again after above author changes, they may have related data - answer = get_object_or_404(Answer, id=answer_id) - onAnswerAccept(answer, request.user) - else: - response_data['allowed'] = 0 - response_data['success'] = 0 - # favorite - elif vote_type == '4': - has_favorited = False - fav_questions = FavoriteQuestion.objects.filter(question=question) - # if the same question has been favorited before, then delete it - if fav_questions is not None: - for item in fav_questions: - if item.user == request.user: - item.delete() - response_data['status'] = 1 - response_data['count'] = len(fav_questions) - 1 - if response_data['count'] < 0: - response_data['count'] = 0 - has_favorited = True - # if above deletion has not been executed, just insert a new favorite question - if not has_favorited: - new_item = FavoriteQuestion(question=question, user=request.user) - new_item.save() - response_data['count'] = FavoriteQuestion.objects.filter(question=question).count() - Question.objects.update_favorite_count(question) - - elif vote_type in ['1', '2', '5', '6']: - post_id = id - post = question - vote_score = 1 - if vote_type in ['5', '6']: - answer_id = request.POST.get('postId') - answer = get_object_or_404(Answer, id=answer_id) - post_id = answer_id - post = answer - if vote_type in ['2', '6']: - vote_score = -1 - - if post.author == request.user: - response_data['allowed'] = -1 - elif not can_vote(vote_score, request.user): - response_data['allowed'] = -2 - elif post.votes.filter(user=request.user).count() > 0: - vote = post.votes.filter(user=request.user)[0] - # unvote should be less than certain time - if (datetime.datetime.now().day - vote.voted_at.day) >= VOTE_RULES['scope_deny_unvote_days']: - response_data['status'] = 2 - else: - voted = vote.vote - if voted > 0: - # cancel upvote - onUpVotedCanceled(vote, post, request.user) - - else: - # cancel downvote - onDownVotedCanceled(vote, post, request.user) - - response_data['status'] = 1 - response_data['count'] = post.score - elif Vote.objects.get_votes_count_today_from_user(request.user) >= VOTE_RULES['scope_votes_per_user_per_day']: - response_data['allowed'] = -3 - else: - vote = Vote(user=request.user, content_object=post, vote=vote_score, voted_at=datetime.datetime.now()) - if vote_score > 0: - # upvote - onUpVoted(vote, post, request.user) - else: - # downvote - onDownVoted(vote, post, request.user) - - votes_left = VOTE_RULES['scope_votes_per_user_per_day'] - Vote.objects.get_votes_count_today_from_user(request.user) - if votes_left <= VOTE_RULES['scope_warn_votes_left']: - response_data['message'] = u'%s votes left' % votes_left - response_data['count'] = post.score - elif vote_type in ['7', '8']: - post = question - post_id = id - if vote_type == '8': - post_id = request.POST.get('postId') - post = get_object_or_404(Answer, id=post_id) - - if FlaggedItem.objects.get_flagged_items_count_today(request.user) >= VOTE_RULES['scope_flags_per_user_per_day']: - response_data['allowed'] = -3 - elif not can_flag_offensive(request.user): - response_data['allowed'] = -2 - elif post.flagged_items.filter(user=request.user).count() > 0: - response_data['status'] = 1 - else: - item = FlaggedItem(user=request.user, content_object=post, flagged_at=datetime.datetime.now()) - onFlaggedItem(item, post, request.user) - response_data['count'] = post.offensive_flag_count - # send signal when question or answer be marked offensive - mark_offensive.send(sender=post.__class__, instance=post, mark_by=request.user) - elif vote_type in ['9', '10']: - post = question - post_id = id - if vote_type == '10': - post_id = request.POST.get('postId') - post = get_object_or_404(Answer, id=post_id) - - if not can_delete_post(request.user, post): - response_data['allowed'] = -2 - elif post.deleted: - onDeleteCanceled(post, request.user) - response_data['status'] = 1 - else: - onDeleted(post, request.user) - delete_post_or_answer.send(sender=post.__class__, instance=post, delete_by=request.user) - else: - response_data['success'] = 0 - response_data['message'] = u'Request mode is not supported. Please try again.' - - data = simplejson.dumps(response_data) - - except Exception, e: - response_data['message'] = str(e) - data = simplejson.dumps(response_data) - return HttpResponse(data, mimetype="application/json") - -def users(request): - is_paginated = True - sortby = request.GET.get('sort', 'reputation') - suser = request.REQUEST.get('q', "") - try: - page = int(request.GET.get('page', '1')) - except ValueError: - page = 1 - - if suser == "": - if sortby == "newest": - objects_list = Paginator(User.objects.all().order_by('-date_joined'), USERS_PAGE_SIZE) - elif sortby == "last": - objects_list = Paginator(User.objects.all().order_by('date_joined'), USERS_PAGE_SIZE) - elif sortby == "user": - objects_list = Paginator(User.objects.all().order_by('username'), USERS_PAGE_SIZE) - # default - else: - objects_list = Paginator(User.objects.all().order_by('-reputation'), USERS_PAGE_SIZE) - base_url = '/users/?sort=%s&' % sortby - else: - sortby = "reputation" - objects_list = Paginator(User.objects.extra(where=['username like %s'], params=['%' + suser + '%']).order_by('-reputation'), USERS_PAGE_SIZE) - base_url = '/users/?name=%s&sort=%s&' % (suser, sortby) - - try: - users = objects_list.page(page) - except (EmptyPage, InvalidPage): - users = objects_list.page(objects_list.num_pages) - - return render_to_response('users.html', { - "users" : users, - "suser" : suser, - "keywords" : suser, - "tab_id" : sortby, - "context" : { - 'is_paginated' : is_paginated, - 'pages': objects_list.num_pages, - 'page': page, - 'has_previous': users.has_previous(), - 'has_next': users.has_next(), - 'previous': users.previous_page_number(), - 'next': users.next_page_number(), - 'base_url' : base_url - } - - }, context_instance=RequestContext(request)) - -def user(request, id): - sort = request.GET.get('sort', 'stats') - user_view = dict((v.id, v) for v in USER_TEMPLATE_VIEWS).get(sort, USER_TEMPLATE_VIEWS[0]) - from forum import views - func = getattr(views, user_view.view_name) - return func(request, id, user_view) - -@login_required -def edit_user(request, id): - user = get_object_or_404(User, id=id) - if request.user != user: - raise Http404 - if request.method == "POST": - form = EditUserForm(user, request.POST) - if form.is_valid(): - user.email = sanitize_html(form.cleaned_data['email']) - user.real_name = sanitize_html(form.cleaned_data['realname']) - user.website = sanitize_html(form.cleaned_data['website']) - user.location = sanitize_html(form.cleaned_data['city']) - user.date_of_birth = sanitize_html(form.cleaned_data['birthday']) - if len(user.date_of_birth) == 0: - user.date_of_birth = '1900-01-01' - user.about = sanitize_html(form.cleaned_data['about']) - - user.save() - # send user updated singal if full fields have been updated - if user.email and user.real_name and user.website and user.location and \ - user.date_of_birth and user.about: - user_updated.send(sender=user.__class__, instance=user, updated_by=user) - return HttpResponseRedirect(user.get_profile_url()) - else: - form = EditUserForm(user) - return render_to_response('user_edit.html', { - 'form' : form, - }, context_instance=RequestContext(request)) - -def user_stats(request, user_id, user_view): - user = get_object_or_404(User, id=user_id) - questions = Question.objects.extra( - select={ - 'vote_count' : 'question.score', - 'favorited_myself' : 'SELECT count(*) FROM favorite_question f WHERE f.user_id = %s AND f.question_id = question.id', - 'la_user_id' : 'auth_user.id', - 'la_username' : 'auth_user.username', - 'la_user_gold' : 'auth_user.gold', - 'la_user_silver' : 'auth_user.silver', - 'la_user_bronze' : 'auth_user.bronze', - 'la_user_reputation' : 'auth_user.reputation' - }, - select_params=[user_id], - tables=['question', 'auth_user'], - where=['question.deleted = 0 AND question.author_id=%s AND question.last_activity_by_id = auth_user.id'], - params=[user_id], - order_by=['-vote_count', '-last_activity_at'] - ).values('vote_count', - 'favorited_myself', - 'id', - 'title', - 'author_id', - 'added_at', - 'answer_accepted', - 'answer_count', - 'comment_count', - 'view_count', - 'favourite_count', - 'summary', - 'tagnames', - 'vote_up_count', - 'vote_down_count', - 'last_activity_at', - 'la_user_id', - 'la_username', - 'la_user_gold', - 'la_user_silver', - 'la_user_bronze', - 'la_user_reputation')[:100] - - answered_questions = Question.objects.extra( - select={ - 'vote_up_count' : 'answer.vote_up_count', - 'vote_down_count' : 'answer.vote_down_count', - 'answer_id' : 'answer.id', - 'accepted' : 'answer.accepted', - 'vote_count' : 'answer.score', - 'comment_count' : 'answer.comment_count' - }, - tables=['question', 'answer'], - where=['answer.deleted=0 AND answer.author_id=%s AND answer.question_id=question.id'], - params=[user_id], - order_by=['-vote_count', '-answer_id'], - select_params=[user_id] - ).distinct().values('comment_count', - 'id', - 'answer_id', - 'title', - 'author_id', - 'accepted', - 'answer_count', - 'vote_up_count', - 'vote_down_count')[:100] - up_votes = Vote.objects.get_up_vote_count_from_user(user) - down_votes = Vote.objects.get_down_vote_count_from_user(user) - votes_today = Vote.objects.get_votes_count_today_from_user(user) - votes_total = VOTE_RULES['scope_votes_per_user_per_day'] - tags = user.created_tags.all().order_by('-used_count')[:50] - awards = Award.objects.extra( - select={'id': 'badge.id', 'count': 'count(badge_id)', 'name':'badge.name', 'description': 'badge.description', 'type': 'badge.type'}, - tables=['award', 'badge'], - order_by=['-awarded_at'], - where=['user_id=%s AND badge_id=badge.id'], - params=[user.id] - ).values('id', 'count', 'name', 'description', 'type') - total_awards = awards.count() - awards.query.group_by = ['badge_id'] - - return render_to_response(user_view.template_file,{ - "tab_name" : user_view.id, - "tab_description" : user_view.tab_description, - "page_title" : user_view.page_title, - "view_user" : user, - "questions" : questions, - "answered_questions" : answered_questions, - "up_votes" : up_votes, - "down_votes" : down_votes, - "total_votes": up_votes + down_votes, - "votes_today_left": votes_total-votes_today, - "votes_total_per_day": votes_total, - "tags" : tags, - "awards": awards, - "total_awards" : total_awards, - }, context_instance=RequestContext(request)) - -def user_recent(request, user_id, user_view): - user = get_object_or_404(User, id=user_id) - def get_type_name(type_id): - for item in TYPE_ACTIVITY: - if type_id in item: - return item[1] - - class Event: - def __init__(self, time, type, title, summary, answer_id, question_id): - self.time = time - self.type = get_type_name(type) - self.type_id = type - self.title = title - self.summary = summary - self.title_link = u'/questions/%s/%s#%s' %(question_id, title, answer_id)\ - if int(answer_id) > 0 else u'/questions/%s/%s' %(question_id, title) - class AwardEvent: - def __init__(self, time, type, id): - self.time = time - self.type = get_type_name(type) - self.type_id = type - self.badge = get_object_or_404(Badge, id=id) - - activities = [] - # ask questions - questions = Activity.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'active_at' : 'activity.active_at', - 'activity_type' : 'activity.activity_type' - }, - tables=['activity', 'question'], - where=['activity.content_type_id = %s AND activity.object_id = question.id AND activity.user_id = %s AND activity.activity_type = %s'], - params=[question_type_id, user_id, TYPE_ACTIVITY_ASK_QUESTION], - order_by=['-activity.active_at'] - ).values( - 'title', - 'question_id', - 'active_at', - 'activity_type' - ) - if len(questions) > 0: - questions = [(Event(q['active_at'], q['activity_type'], q['title'], '', '0', \ - q['question_id'])) for q in questions] - activities.extend(questions) - - # answers - answers = Activity.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'answer_id' : 'answer.id', - 'active_at' : 'activity.active_at', - 'activity_type' : 'activity.activity_type' - }, - tables=['activity', 'answer', 'question'], - where=['activity.content_type_id = %s AND activity.object_id = answer.id ' - 'AND answer.question_id=question.id AND activity.user_id=%s AND activity.activity_type=%s'], - params=[answer_type_id, user_id, TYPE_ACTIVITY_ANSWER], - order_by=['-activity.active_at'] - ).values( - 'title', - 'question_id', - 'answer_id', - 'active_at', - 'activity_type' - ) - if len(answers) > 0: - answers = [(Event(q['active_at'], q['activity_type'], q['title'], '', q['answer_id'], \ - q['question_id'])) for q in answers] - activities.extend(answers) - - # question comments - comments = Activity.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'comment.object_id', - 'added_at' : 'comment.added_at', - 'activity_type' : 'activity.activity_type' - }, - tables=['activity', 'question', 'comment'], - - where=['activity.content_type_id = %s AND activity.object_id = comment.id AND activity.user_id = comment.user_id AND comment.object_id=question.id AND comment.content_type_id=%s AND activity.user_id = %s AND activity.activity_type=%s'], - params=[comment_type_id, question_type_id, user_id, TYPE_ACTIVITY_COMMENT_QUESTION], - order_by=['-comment.added_at'] - ).values( - 'title', - 'question_id', - 'added_at', - 'activity_type' - ) - - if len(comments) > 0: - comments = [(Event(q['added_at'], q['activity_type'], q['title'], '', '0', \ - q['question_id'])) for q in comments] - activities.extend(comments) - - # answer comments - comments = Activity.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'answer_id' : 'answer.id', - 'added_at' : 'comment.added_at', - 'activity_type' : 'activity.activity_type' - }, - tables=['activity', 'question', 'answer', 'comment'], - - where=['activity.content_type_id = %s AND activity.object_id = comment.id AND activity.user_id = comment.user_id AND comment.object_id=answer.id AND comment.content_type_id=%s AND question.id = answer.question_id AND activity.user_id = %s AND activity.activity_type=%s'], - params=[comment_type_id, answer_type_id, user_id, TYPE_ACTIVITY_COMMENT_ANSWER], - order_by=['-comment.added_at'] - ).values( - 'title', - 'question_id', - 'answer_id', - 'added_at', - 'activity_type' - ) - - if len(comments) > 0: - comments = [(Event(q['added_at'], q['activity_type'], q['title'], '', q['answer_id'], \ - q['question_id'])) for q in comments] - activities.extend(comments) - - # question revisions - revisions = Activity.objects.extra( - select={ - 'title' : 'question_revision.title', - 'question_id' : 'question_revision.question_id', - 'added_at' : 'activity.active_at', - 'activity_type' : 'activity.activity_type', - 'summary' : 'question_revision.summary' - }, - tables=['activity', 'question_revision'], - where=['activity.content_type_id = %s AND activity.object_id = question_revision.id AND activity.user_id = question_revision.author_id AND activity.user_id = %s AND activity.activity_type=%s'], - params=[question_revision_type_id, user_id, TYPE_ACTIVITY_UPDATE_QUESTION], - order_by=['-activity.active_at'] - ).values( - 'title', - 'question_id', - 'added_at', - 'activity_type', - 'summary' - ) - - if len(revisions) > 0: - revisions = [(Event(q['added_at'], q['activity_type'], q['title'], q['summary'], '0', \ - q['question_id'])) for q in revisions] - activities.extend(revisions) - - # answer revisions - revisions = Activity.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'answer_id' : 'answer.id', - 'added_at' : 'activity.active_at', - 'activity_type' : 'activity.activity_type', - 'summary' : 'answer_revision.summary' - }, - tables=['activity', 'answer_revision', 'question', 'answer'], - - where=['activity.content_type_id = %s AND activity.object_id = answer_revision.id AND activity.user_id = answer_revision.author_id AND activity.user_id = %s AND answer_revision.answer_id=answer.id AND answer.question_id = question.id AND activity.activity_type=%s'], - params=[answer_revision_type_id, user_id, TYPE_ACTIVITY_UPDATE_ANSWER], - order_by=['-activity.active_at'] - ).values( - 'title', - 'question_id', - 'added_at', - 'answer_id', - 'activity_type', - 'summary' - ) - - if len(revisions) > 0: - revisions = [(Event(q['added_at'], q['activity_type'], q['title'], q['summary'], \ - q['answer_id'], q['question_id'])) for q in revisions] - activities.extend(revisions) - - # accepted answers - accept_answers = Activity.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'added_at' : 'activity.active_at', - 'activity_type' : 'activity.activity_type', - }, - tables=['activity', 'answer', 'question'], - where=['activity.content_type_id = %s AND activity.object_id = answer.id AND activity.user_id = question.author_id AND activity.user_id = %s AND answer.question_id=question.id AND activity.activity_type=%s'], - params=[answer_type_id, user_id, TYPE_ACTIVITY_MARK_ANSWER], - order_by=['-activity.active_at'] - ).values( - 'title', - 'question_id', - 'added_at', - 'activity_type', - ) - if len(accept_answers) > 0: - accept_answers = [(Event(q['added_at'], q['activity_type'], q['title'], '', '0', \ - q['question_id'])) for q in accept_answers] - activities.extend(accept_answers) - #award history - awards = Activity.objects.extra( - select={ - 'badge_id' : 'badge.id', - 'awarded_at': 'award.awarded_at', - 'activity_type' : 'activity.activity_type' - }, - tables=['activity', 'award', 'badge'], - where=['activity.user_id = award.user_id AND activity.user_id = %s AND award.badge_id=badge.id AND activity.object_id=award.id AND activity.activity_type=%s'], - params=[user_id, TYPE_ACTIVITY_PRIZE], - order_by=['-activity.active_at'] - ).values( - 'badge_id', - 'awarded_at', - 'activity_type' - ) - if len(awards) > 0: - awards = [(AwardEvent(q['awarded_at'], q['activity_type'], q['badge_id'])) for q in awards] - activities.extend(awards) - - activities.sort(lambda x,y: cmp(y.time, x.time)) - - return render_to_response(user_view.template_file,{ - "tab_name" : user_view.id, - "tab_description" : user_view.tab_description, - "page_title" : user_view.page_title, - "view_user" : user, - "activities" : activities[:user_view.data_size] - }, context_instance=RequestContext(request)) - -def user_responses(request, user_id, user_view): - """ - We list answers for question, comments, and answer accepted by others for this user. - """ - class Response: - def __init__(self, type, title, question_id, answer_id, time, username, user_id, content): - self.type = type - self.title = title - self.titlelink = u'/questions/%s/%s#%s' % (question_id, title, answer_id) - self.time = time - self.userlink = u'/users/%s/%s/' % (user_id, username) - self.username = username - self.content = u'%s ...' % strip_tags(content)[:300] - - def __unicode__(self): - return u'%s %s' % (self.type, self.titlelink) - - user = get_object_or_404(User, id=user_id) - responses = [] - answers = Answer.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'answer_id' : 'answer.id', - 'added_at' : 'answer.added_at', - 'html' : 'answer.html', - 'username' : 'auth_user.username', - 'user_id' : 'auth_user.id' - }, - select_params=[user_id], - tables=['answer', 'question', 'auth_user'], - where=['answer.question_id = question.id AND answer.deleted=0 AND question.deleted = 0 AND question.author_id = %s AND answer.author_id <> %s AND answer.author_id=auth_user.id'], - params=[user_id, user_id], - order_by=['-answer.id'] - ).values( - 'title', - 'question_id', - 'answer_id', - 'added_at', - 'html', - 'username', - 'user_id' - ) - if len(answers) > 0: - answers = [(Response(TYPE_RESPONSE['QUESTION_ANSWERED'], a['title'], a['question_id'], - a['answer_id'], a['added_at'], a['username'], a['user_id'], a['html'])) for a in answers] - responses.extend(answers) - - - # question comments - comments = Comment.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'comment.object_id', - 'added_at' : 'comment.added_at', - 'comment' : 'comment.comment', - 'username' : 'auth_user.username', - 'user_id' : 'auth_user.id' - }, - tables=['question', 'auth_user', 'comment'], - where=['question.deleted = 0 AND question.author_id = %s AND comment.object_id=question.id AND comment.content_type_id=%s AND comment.user_id <> %s AND comment.user_id = auth_user.id'], - params=[user_id, question_type_id, user_id], - order_by=['-comment.added_at'] - ).values( - 'title', - 'question_id', - 'added_at', - 'comment', - 'username', - 'user_id' - ) - - if len(comments) > 0: - comments = [(Response(TYPE_RESPONSE['QUESTION_COMMENTED'], c['title'], c['question_id'], - '', c['added_at'], c['username'], c['user_id'], c['comment'])) for c in comments] - responses.extend(comments) - - # answer comments - comments = Comment.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'answer_id' : 'answer.id', - 'added_at' : 'comment.added_at', - 'comment' : 'comment.comment', - 'username' : 'auth_user.username', - 'user_id' : 'auth_user.id' - }, - tables=['answer', 'auth_user', 'comment', 'question'], - where=['answer.deleted = 0 AND answer.author_id = %s AND comment.object_id=answer.id AND comment.content_type_id=%s AND comment.user_id <> %s AND comment.user_id = auth_user.id AND question.id = answer.question_id'], - params=[user_id, answer_type_id, user_id], - order_by=['-comment.added_at'] - ).values( - 'title', - 'question_id', - 'answer_id', - 'added_at', - 'comment', - 'username', - 'user_id' - ) - - if len(comments) > 0: - comments = [(Response(TYPE_RESPONSE['ANSWER_COMMENTED'], c['title'], c['question_id'], - c['answer_id'], c['added_at'], c['username'], c['user_id'], c['comment'])) for c in comments] - responses.extend(comments) - - # answer has been accepted - answers = Answer.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'answer_id' : 'answer.id', - 'added_at' : 'answer.accepted_at', - 'html' : 'answer.html', - 'username' : 'auth_user.username', - 'user_id' : 'auth_user.id' - }, - select_params=[user_id], - tables=['answer', 'question', 'auth_user'], - where=['answer.question_id = question.id AND answer.deleted=0 AND question.deleted = 0 AND answer.author_id = %s AND answer.accepted=1 AND question.author_id=auth_user.id'], - params=[user_id], - order_by=['-answer.id'] - ).values( - 'title', - 'question_id', - 'answer_id', - 'added_at', - 'html', - 'username', - 'user_id' - ) - if len(answers) > 0: - answers = [(Response(TYPE_RESPONSE['ANSWER_ACCEPTED'], a['title'], a['question_id'], - a['answer_id'], a['added_at'], a['username'], a['user_id'], a['html'])) for a in answers] - responses.extend(answers) - - # sort posts by time - responses.sort(lambda x,y: cmp(y.time, x.time)) - - return render_to_response(user_view.template_file,{ - "tab_name" : user_view.id, - "tab_description" : user_view.tab_description, - "page_title" : user_view.page_title, - "view_user" : user, - "responses" : responses[:user_view.data_size], - - }, context_instance=RequestContext(request)) - -def user_votes(request, user_id, user_view): - user = get_object_or_404(User, id=user_id) - if not can_view_user_votes(request.user, user): - raise Http404 - votes = [] - question_votes = Vote.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'answer_id' : 0, - 'voted_at' : 'vote.voted_at', - 'vote' : 'vote', - }, - select_params=[user_id], - tables=['vote', 'question', 'auth_user'], - where=['vote.content_type_id = %s AND vote.user_id = %s AND vote.object_id = question.id AND vote.user_id=auth_user.id'], - params=[question_type_id, user_id], - order_by=['-vote.id'] - ).values( - 'title', - 'question_id', - 'answer_id', - 'voted_at', - 'vote', - ) - if(len(question_votes) > 0): - votes.extend(question_votes) - - answer_votes = Vote.objects.extra( - select={ - 'title' : 'question.title', - 'question_id' : 'question.id', - 'answer_id' : 'answer.id', - 'voted_at' : 'vote.voted_at', - 'vote' : 'vote', - }, - select_params=[user_id], - tables=['vote', 'answer', 'question', 'auth_user'], - where=['vote.content_type_id = %s AND vote.user_id = %s AND vote.object_id = answer.id AND answer.question_id = question.id AND vote.user_id=auth_user.id'], - params=[answer_type_id, user_id], - order_by=['-vote.id'] - ).values( - 'title', - 'question_id', - 'answer_id', - 'voted_at', - 'vote', - ) - if(len(answer_votes) > 0): - votes.extend(answer_votes) - votes.sort(lambda x,y: cmp(y['voted_at'], x['voted_at'])) - return render_to_response(user_view.template_file,{ - "tab_name" : user_view.id, - "tab_description" : user_view.tab_description, - "page_title" : user_view.page_title, - "view_user" : user, - "votes" : votes[:user_view.data_size] - - }, context_instance=RequestContext(request)) - -def user_reputation(request, user_id, user_view): - user = get_object_or_404(User, id=user_id) - reputation = Repute.objects.extra( - select={'positive': 'sum(positive)', 'negative': 'sum(negative)', 'question_id':'question_id', 'title': 'question.title'}, - tables=['repute', 'question'], - order_by=['-reputed_at'], - where=['user_id=%s AND question_id=question.id'], - params=[user.id] - ).values('positive', 'negative', 'question_id', 'title', 'reputed_at', 'reputation') - - reputation.query.group_by = ['question_id'] - - rep_list = [] - for rep in Repute.objects.filter(user=user).order_by('reputed_at'): - dic = '[%s,%s]' % (calendar.timegm(rep.reputed_at.timetuple()) * 1000, rep.reputation) - rep_list.append(dic) - reps = ','.join(rep_list) - reps = '[%s]' % reps - - return render_to_response(user_view.template_file,{ - "tab_name" : user_view.id, - "tab_description" : user_view.tab_description, - "page_title" : user_view.page_title, - "view_user" : user, - "reputation" : reputation, - "reps" : reps - }, context_instance=RequestContext(request)) - -def user_favorites(request, user_id, user_view): - user = get_object_or_404(User, id=user_id) - questions = Question.objects.extra( - select={ - 'vote_count' : 'question.vote_up_count + question.vote_down_count', - 'favorited_myself' : 'SELECT count(*) FROM favorite_question f WHERE f.user_id = %s AND f.question_id = question.id', - 'la_user_id' : 'auth_user.id', - 'la_username' : 'auth_user.username', - 'la_user_gold' : 'auth_user.gold', - 'la_user_silver' : 'auth_user.silver', - 'la_user_bronze' : 'auth_user.bronze', - 'la_user_reputation' : 'auth_user.reputation' - }, - select_params=[user_id], - tables=['question', 'auth_user', 'favorite_question'], - where=['question.deleted = 0 AND question.last_activity_by_id = auth_user.id AND favorite_question.question_id = question.id AND favorite_question.user_id = %s'], - params=[user_id], - order_by=['-vote_count', '-question.id'] - ).values('vote_count', - 'favorited_myself', - 'id', - 'title', - 'author_id', - 'added_at', - 'answer_accepted', - 'answer_count', - 'comment_count', - 'view_count', - 'favourite_count', - 'summary', - 'tagnames', - 'vote_up_count', - 'vote_down_count', - 'last_activity_at', - 'la_user_id', - 'la_username', - 'la_user_gold', - 'la_user_silver', - 'la_user_bronze', - 'la_user_reputation') - return render_to_response(user_view.template_file,{ - "tab_name" : user_view.id, - "tab_description" : user_view.tab_description, - "page_title" : user_view.page_title, - "questions" : questions[:user_view.data_size], - "view_user" : user - }, context_instance=RequestContext(request)) - - -def user_preferences(request, user_id, user_view): - user = get_object_or_404(User, id=user_id) - return render_to_response(user_view.template_file,{ - "tab_name" : user_view.id, - "tab_description" : user_view.tab_description, - "page_title" : user_view.page_title, - "view_user" : user, - }, context_instance=RequestContext(request)) - -def question_comments(request, id): - question = get_object_or_404(Question, id=id) - user = request.user - return __comments(request, question, 'question', user) - -def answer_comments(request, id): - answer = get_object_or_404(Answer, id=id) - user = request.user - return __comments(request, answer, 'answer', user) - -def __comments(request, obj, type, user): - # only support get comments by ajax now - if request.is_ajax(): - if request.method == "GET": - return __generate_comments_json(obj, type, user) - elif request.method == "POST": - comment_data = request.POST.get('comment') - comment = Comment(content_object=obj, comment=comment_data, user=request.user) - comment.save() - obj.comment_count = obj.comment_count + 1 - obj.save() - return __generate_comments_json(obj, type, user) - -def __generate_comments_json(obj, type, user): - comments = obj.comments.all().order_by('-id') - # {"Id":6,"PostId":38589,"CreationDate":"an hour ago","Text":"hello there!","UserDisplayName":"Jarrod Dixon","UserUrl":"/users/3/jarrod-dixon","DeleteUrl":null} - json_comments = [] - for comment in comments: - comment_user = comment.user - delete_url = "" - if user != None and auth.can_delete_comment(user, comment): - #/posts/392845/comments/219852/delete - delete_url = "/" + type + "s/%s/comments/%s/delete/" % (obj.id, comment.id) - json_comments.append({"id" : comment.id, - "object_id" : obj.id, - "add_date" : comment.added_at.strftime('%Y-%m-%d'), - "text" : comment.comment, - "user_display_name" : comment_user.username, - "user_url" : "/users/%s/%s" % (comment_user.id, comment_user.username), - "delete_url" : delete_url - }) - - data = simplejson.dumps(json_comments) - return HttpResponse(data, mimetype="application/json") - -def delete_question_comment(request, question_id, comment_id): - if request.is_ajax(): - question = get_object_or_404(Question, id=question_id) - comment = get_object_or_404(Comment, id=comment_id) - - question.comments.remove(comment) - question.comment_count = question.comment_count - 1 - question.save() - user = request.user - return __generate_comments_json(question, 'question', user) - -def delete_answer_comment(request, answer_id, comment_id): - if request.is_ajax(): - answer = get_object_or_404(Answer, id=answer_id) - comment = get_object_or_404(Comment, id=comment_id) - - answer.comments.remove(comment) - answer.comment_count = answer.comment_count - 1 - answer.save() - user = request.user - return __generate_comments_json(answer, 'answer', user) - -def logout(request): - url = request.GET.get('next') - return render_to_response('logout.html', { - 'next' : url, - }, context_instance=RequestContext(request)) - -def badges(request): - badges = Badge.objects.all().order_by('type') - my_badges = [] - if request.user.is_authenticated(): - my_badges = Award.objects.filter(user=request.user) - my_badges.query.group_by = ['badge_id'] - - return render_to_response('badges.html', { - 'badges' : badges, - 'mybadges' : my_badges, - }, context_instance=RequestContext(request)) - -def badge(request, id): - badge = get_object_or_404(Badge, id=id) - awards = Award.objects.extra( - select={'id': 'auth_user.id', 'name': 'auth_user.username', 'rep':'auth_user.reputation', 'gold': 'auth_user.gold', 'silver': 'auth_user.silver', 'bronze': 'auth_user.bronze'}, - tables=['award', 'auth_user'], - where=['badge_id=%s AND user_id=auth_user.id'], - params=[id] - ).values('id').distinct() - - return render_to_response('badge.html', { - 'awards' : awards, - 'badge' : badge, - }, context_instance=RequestContext(request)) - -def read_message(request): - if request.method == "POST": - if request.POST['formdata'] == 'required': - request.session['message_silent'] = 1 - - if request.user.is_authenticated(): - request.user.delete_messages() - return HttpResponse('') - -def upload(request): - class FileTypeNotAllow(Exception): - pass - class FileSizeNotAllow(Exception): - pass - class UploadPermissionNotAuthorized(Exception): - pass - - #%s - xml_template = "%s" - - try: - f = request.FILES['file-upload'] - # check upload permission - if not can_upload_files(request.user): - raise UploadPermissionNotAuthorized - - # check file type - file_name_suffix = os.path.splitext(f.name)[1].lower() - if not file_name_suffix in settings.ALLOW_FILE_TYPES: - raise FileTypeNotAllow - - # genetate new file name - new_file_name = str(time.time()).replace('.', str(random.randint(0,100000))) + file_name_suffix - # use default storage to store file - default_storage.save(new_file_name, f) - # check file size - # byte - size = default_storage.size(new_file_name) - if size > settings.ALLOW_MAX_FILE_SIZE: - default_storage.delete(new_file_name) - raise FileSizeNotAllow - - result = xml_template % ('Good', '', default_storage.url(new_file_name)) - except UploadPermissionNotAuthorized: - result = xml_template % ('', _('uploading images is limited to users with >60 reputation points'), '') - except FileTypeNotAllow: - result = xml_template % ('', _("allowed file types are 'jpg', 'jpeg', 'gif', 'bmp', 'png', 'tiff'"), '') - except FileSizeNotAllow: - result = xml_template % ('', _("maximum upload file size is %sK") % settings.ALLOW_MAX_FILE_SIZE / 1024, '') - except Exception as e: - result = xml_template % ('', _('Error uploading file. Please contact the site administrator. Thank you. %s' % e), '') - - return HttpResponse(result, mimetype="application/xml") - -def books(request): - return HttpResponseRedirect("/books/mysql-zhaoyang") - -def book(request, short_name, unanswered=False): - """ - 1. questions list - 2. book info - 3. author info and blog rss items - """ - """ - List of Questions, Tagged questions, and Unanswered questions. - """ - books = Book.objects.extra(where=['short_name = %s'], params=[short_name]) - match_count = len(books) - if match_count == 0 : - raise Http404 - else: - # the book info - book = books[0] - # get author info - author_info = BookAuthorInfo.objects.get(book=book) - # get author rss info - author_rss = BookAuthorRss.objects.filter(book=book) - - # get pagesize from session, if failed then get default value - user_page_size = request.session.get("pagesize", QUESTIONS_PAGE_SIZE) - # set pagesize equal to logon user specified value in database - if request.user.is_authenticated() and request.user.questions_per_page > 0: - user_page_size = request.user.questions_per_page - - try: - page = int(request.GET.get('page', '1')) - except ValueError: - page = 1 - - view_id = request.GET.get('sort', None) - view_dic = {"latest":"-added_at", "active":"-last_activity_at", "hottest":"-answer_count", "mostvoted":"-score" } - try: - orderby = view_dic[view_id] - except KeyError: - view_id = "latest" - orderby = "-added_at" - - # check if request is from tagged questions - if unanswered: - # check if request is from unanswered questions - # Article.objects.filter(publications__id__exact=1) - objects = Question.objects.filter(book__id__exact=book.id, deleted=False, answer_count=0).order_by(orderby) - else: - objects = Question.objects.filter(book__id__exact=book.id, deleted=False).order_by(orderby) - - # RISK - inner join queries - objects = objects.select_related(); - objects_list = Paginator(objects, user_page_size) - questions = objects_list.page(page) - - return render_to_response('book.html', { - "book" : book, - "author_info" : author_info, - "author_rss" : author_rss, - "questions" : questions, - "context" : { - 'is_paginated' : True, - 'pages': objects_list.num_pages, - 'page': page, - 'has_previous': questions.has_previous(), - 'has_next': questions.has_next(), - 'previous': questions.previous_page_number(), - 'next': questions.next_page_number(), - 'base_url' : request.path + '?sort=%s&' % view_id, - 'pagesize' : user_page_size - } - }, context_instance=RequestContext(request)) - -@login_required -def ask_book(request, short_name): - if request.method == "POST": - form = AskForm(request.POST) - if form.is_valid(): - added_at = datetime.datetime.now() - html = sanitize_html(markdowner.convert(form.cleaned_data['text'])) - question = Question( - title = strip_tags(form.cleaned_data['title']), - author = request.user, - added_at = added_at, - last_activity_at = added_at, - last_activity_by = request.user, - wiki = form.cleaned_data['wiki'], - tagnames = form.cleaned_data['tags'].strip(), - html = html, - summary = strip_tags(html)[:120] - ) - if question.wiki: - question.last_edited_by = question.author - question.last_edited_at = added_at - question.wikified_at = added_at - - question.save() - - # create the first revision - QuestionRevision.objects.create( - question = question, - revision = 1, - title = question.title, - author = request.user, - revised_at = added_at, - tagnames = question.tagnames, - summary = CONST['default_version'], - text = form.cleaned_data['text'] - ) - - books = Book.objects.extra(where=['short_name = %s'], params=[short_name]) - match_count = len(books) - if match_count == 1: - # the book info - book = books[0] - book.questions.add(question) - - return HttpResponseRedirect(question.get_absolute_url()) - else: - form = AskForm() - - tags = _get_tags_cache_json() - return render_to_response('ask.html', { - 'form' : form, - 'tags' : tags, - }, context_instance=RequestContext(request)) - -def search(request): - """ - Search by question, user and tag keywords. - For questions now we only search keywords in question title. - """ - if request.method == "GET": - keywords = request.GET.get("q") - search_type = request.GET.get("t") - try: - page = int(request.GET.get('page', '1')) - except ValueError: - page = 1 - if keywords is None: - return HttpResponseRedirect('/') - if search_type == 'tag': - return HttpResponseRedirect('/tags/?q=%s&page=%s' % (keywords.strip(), page)) - elif search_type == "user": - return HttpResponseRedirect('/users/?q=%s&page=%s' % (keywords.strip(), page)) - elif search_type == "question": - - template_file = "questions.html" - # Set flag to False by default. If it is equal to True, then need to be saved. - pagesize_changed = False - # get pagesize from session, if failed then get default value - user_page_size = request.session.get("pagesize", QUESTIONS_PAGE_SIZE) - # set pagesize equal to logon user specified value in database - if request.user.is_authenticated() and request.user.questions_per_page > 0: - user_page_size = request.user.questions_per_page - - try: - page = int(request.GET.get('page', '1')) - # get new pagesize from UI selection - pagesize = int(request.GET.get('pagesize', user_page_size)) - if pagesize <> user_page_size: - pagesize_changed = True - - except ValueError: - page = 1 - pagesize = user_page_size - - # save this pagesize to user database - if pagesize_changed: - request.session["pagesize"] = pagesize - if request.user.is_authenticated(): - user = request.user - user.questions_per_page = pagesize - user.save() - - view_id = request.GET.get('sort', None) - view_dic = {"latest":"-added_at", "active":"-last_activity_at", "hottest":"-answer_count", "mostvoted":"-score" } - try: - orderby = view_dic[view_id] - except KeyError: - view_id = "latest" - orderby = "-added_at" - - objects = Question.objects.filter(deleted=False).extra(where=['title like %s'], params=['%' + keywords + '%']).order_by(orderby) - - # RISK - inner join queries - objects = objects.select_related(); - objects_list = Paginator(objects, pagesize) - questions = objects_list.page(page) - - # Get related tags from this page objects - related_tags = [] - for question in questions.object_list: - tags = list(question.tags.all()) - for tag in tags: - if tag not in related_tags: - related_tags.append(tag) - - return render_to_response(template_file, { - "questions" : questions, - "tab_id" : view_id, - "questions_count" : objects_list.count, - "tags" : related_tags, - "searchtag" : None, - "searchtitle" : keywords, - "keywords" : keywords, - "is_unanswered" : False, - "context" : { - 'is_paginated' : True, - 'pages': objects_list.num_pages, - 'page': page, - 'has_previous': questions.has_previous(), - 'has_next': questions.has_next(), - 'previous': questions.previous_page_number(), - 'next': questions.next_page_number(), - 'base_url' : request.path + '?t=question&q=%s&sort=%s&' % (keywords, view_id), - 'pagesize' : pagesize - }}, context_instance=RequestContext(request)) - - else: - raise Http404 - diff --git a/junk b/junk deleted file mode 100644 index 3f3226d6..00000000 --- a/junk +++ /dev/null @@ -1,7 +0,0 @@ -/branches/beta2/forum/feed.py r110 line 17: -/branches/beta2/forum/feed.py r110 line 20: -/branches/beta2/forum/forms.py r110 line 63: -/branches/beta2/templates/question.html r120 line 237: -/branches/beta2/templates/question.html r120 line 57: -/branches/beta2/templates/question.html r120 line 456: -/branches/beta2/forum/views.py r127 line 1088: diff --git a/lanai.psproj b/lanai.psproj deleted file mode 100644 index 7f44d7ff..00000000 --- a/lanai.psproj +++ /dev/null @@ -1,557 +0,0 @@ -[PyScripter] -Version=1.9.9.3 - -[Project] -ClassName=TProjectRootNode -StoreRelativePaths=FALSE -ShowFileExtensions=FALSE - -[Project\ChildNodes] -Count=2 - -[Project\ChildNodes\Node0] -ClassName=TProjectFilesNode - -[Project\ChildNodes\Node0\ChildNodes] -Count=1 - -[Project\ChildNodes\Node0\ChildNodes\Node0] -ClassName=TProjectFolderNode -Name=src - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] -Count=10 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0] -ClassName=TProjectFolderNode -Name=django_authopenid - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] -Count=9 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\__init__.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\admin.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\forms.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\middleware.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\mimeparse.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node5] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\models.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node6] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\urls.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node7] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\util.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node8] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\django_authopenid\views.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1] -ClassName=TProjectFolderNode -Name=forum - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes] -Count=12 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node0] -ClassName=TProjectFolderNode -Name=management - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node0\ChildNodes] -Count=2 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0] -ClassName=TProjectFolderNode -Name=commands - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] -Count=3 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\management\commands\__init__.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\management\commands\mark_offensive_cron.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\management\commands\sample_command.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\management\__init__.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node1] -ClassName=TProjectFolderNode -Name=templatetags - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node1\ChildNodes] -Count=3 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node1\ChildNodes\Node0] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\templatetags\__init__.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node1\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\templatetags\extra_filters.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node1\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\templatetags\extra_tags.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\__init__.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node3] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\admin.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node4] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\auth.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node5] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\const.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node6] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\diff.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node7] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\forms.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node8] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\managers.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node9] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\models.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node10] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\user.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1\ChildNodes\Node11] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\forum\views.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] -ClassName=TProjectFolderNode -Name=sql_scripts - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2\ChildNodes] -Count=6 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2\ChildNodes\Node0] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\sql_scripts\cnprog_new_install.sql - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\sql_scripts\update_2009_01_13_001.sql - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\sql_scripts\update_2009_01_13_002.sql - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2\ChildNodes\Node3] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\sql_scripts\update_2009_12_24_001.sql - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2\ChildNodes\Node4] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\sql_scripts\update_2009_12_27_001.sql - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2\ChildNodes\Node5] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\sql_scripts\update_2009_12_27_002.sql - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3] -ClassName=TProjectFolderNode -Name=templates - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes] -Count=44 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0] -ClassName=TProjectFolderNode -Name=authopenid - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes] -Count=10 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node0] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\changeemail.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\changeopenid.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\changepw.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node3] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\complete.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node4] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\delete.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node5] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\failure.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node6] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\sendpw.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node7] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\settings.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node8] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\signin.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node0\ChildNodes\Node9] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\authopenid\signup.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1] -ClassName=TProjectFolderNode -Name=content - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes] -Count=2 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0] -ClassName=TProjectFolderNode -Name=js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes] -Count=10 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0] -ClassName=TProjectFolderNode -Name=wmd - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0\ChildNodes] -Count=3 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node0] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\wmd\showdown.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\wmd\wmd-base.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\wmd\wmd-plus.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\com.cnprog.editor.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\com.cnprog.post.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node3] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\com.cnprog.utils.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node4] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\excanvas.pack.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node5] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\jquery.flot.pack.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node6] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\jquery.openid.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node7] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\jquery.validate.pack.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node8] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\jquery-1.2.6.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node0\ChildNodes\Node9] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\js\jquery-1.2.6.min.js - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node1] -ClassName=TProjectFolderNode -Name=style - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node1\ChildNodes] -Count=4 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node1\ChildNodes\Node0] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\style\default.css - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node1\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\style\jquery.autocomplete.css - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node1\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\style\openid.css - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node1\ChildNodes\Node1\ChildNodes\Node3] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\content\style\prettify.css - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\404.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node3] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\500.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node4] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\about.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node5] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\answer_edit.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node6] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\ask.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node7] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\badge.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node8] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\badges.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node9] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\base.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node10] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\base_content.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node11] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\close.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node12] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\faq.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node13] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\footer.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node14] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\header.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node15] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\index.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node16] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\logout.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node17] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\pagesize.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node18] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\paginator.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node19] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\privacy.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node20] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\question.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node21] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\question_edit.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node22] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\question_retag.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node23] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\questions.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node24] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\reopen.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node25] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\revisions_answer.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node26] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\revisions_question.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node27] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\sidebar.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node28] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\tags.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node29] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\unanswered.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node30] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node31] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_edit.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node32] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_favorites.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node33] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_footer.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node34] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_info.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node35] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_preferences.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node36] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_recent.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node37] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_reputation.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node38] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_responses.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node39] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_stats.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node40] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_tabs.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node41] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\user_votes.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node42] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\users.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node3\ChildNodes\Node43] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\templates\users_questions.html - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4] -ClassName=TProjectFolderNode -Name=utils - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4\ChildNodes] -Count=4 - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4\ChildNodes\Node0] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\utils\__init__.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4\ChildNodes\Node1] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\utils\cache.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4\ChildNodes\Node2] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\utils\html.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node4\ChildNodes\Node3] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\utils\lists.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node5] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\__init__.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node6] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\manage.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node7] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\settings.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node8] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\test.py - -[Project\ChildNodes\Node0\ChildNodes\Node0\ChildNodes\Node9] -ClassName=TProjectFileNode -FileName=C:\Projects\Lanai\src\urls.py - -[Project\ChildNodes\Node1] -ClassName=TProjectRunConfiguationsNode - -[Project\ExtraPythonPath] -Count=0 - diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po deleted file mode 100644 index c4c1e674..00000000 --- a/locale/en/LC_MESSAGES/django.po +++ /dev/null @@ -1,2540 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-06-22 20:40-0400\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: settings.py:32 -msgid "account/" -msgstr "" - -#: settings.py:32 django_authopenid/urls.py:9 django_authopenid/urls.py:11 -msgid "signin/" -msgstr "" - -#: django_authopenid/forms.py:67 django_authopenid/views.py:93 -msgid "i-names are not supported" -msgstr "" - -#: django_authopenid/forms.py:102 django_authopenid/forms.py:207 -msgid "" -"Usernames can only contain letters, numbers and " -"underscores" -msgstr "" - -#: django_authopenid/forms.py:109 -msgid "" -"This username does not exist in our database. Please " -"choose another." -msgstr "" - -#: django_authopenid/forms.py:126 django_authopenid/forms.py:231 -msgid "" -"Please enter a valid username and password. Note that " -"both fields are case-sensitive." -msgstr "" - -#: django_authopenid/forms.py:130 django_authopenid/forms.py:235 -msgid "This account is inactive." -msgstr "" - -#: django_authopenid/forms.py:158 -msgid "invalid user name" -msgstr "" - -#: django_authopenid/forms.py:160 -msgid "sorry, this name can not be used, please try another" -msgstr "" - -#: django_authopenid/forms.py:162 -msgid "username too short" -msgstr "" - -#: django_authopenid/forms.py:170 django_authopenid/forms.py:171 -msgid "this name is already in use - please try anoter" -msgstr "" - -#: django_authopenid/forms.py:184 -msgid "" -"This email is already registered in our database. Please " -"choose another." -msgstr "" - -#: django_authopenid/forms.py:214 -msgid "" -"This username don't exist. Please choose another." -msgstr "" - -#: django_authopenid/forms.py:253 -msgid "choose a username" -msgstr "" - -#: django_authopenid/forms.py:255 templates/authopenid/signup.html:36 -msgid "your email address" -msgstr "" - -#: django_authopenid/forms.py:257 templates/authopenid/signup.html:37 -msgid "choose password" -msgstr "" - -#: django_authopenid/forms.py:259 templates/authopenid/signup.html:38 -msgid "retype password" -msgstr "" - -#: django_authopenid/forms.py:330 -msgid "" -"Old password is incorrect. Please enter the correct " -"password." -msgstr "" - -#: django_authopenid/forms.py:342 -msgid "new passwords do not match" -msgstr "" - -#: django_authopenid/forms.py:434 -msgid "Incorrect username." -msgstr "" - -#: django_authopenid/urls.py:10 -msgid "signout/" -msgstr "" - -#: django_authopenid/urls.py:11 -msgid "complete/" -msgstr "" - -#: django_authopenid/urls.py:13 -msgid "register/" -msgstr "" - -#: django_authopenid/urls.py:14 -msgid "signup/" -msgstr "" - -#: django_authopenid/urls.py:16 -msgid "sendpw/" -msgstr "" - -#: django_authopenid/urls.py:26 -msgid "delete/" -msgstr "" - -#: django_authopenid/views.py:99 -#, python-format -msgid "闈炴硶OpenID鍦板潃锛 %s" -msgstr "" - -#: django_authopenid/views.py:366 -msgid "Welcome" -msgstr "" - -#: django_authopenid/views.py:456 -msgid "Password changed." -msgstr "" - -#: django_authopenid/views.py:488 -msgid "Email changed." -msgstr "" - -#: django_authopenid/views.py:519 django_authopenid/views.py:671 -#, python-format -msgid "No OpenID %s found associated in our database" -msgstr "" - -#: django_authopenid/views.py:523 django_authopenid/views.py:678 -#, python-format -msgid "The OpenID %s isn't associated to current user logged in" -msgstr "" - -#: django_authopenid/views.py:531 -msgid "Email Changed." -msgstr "" - -#: django_authopenid/views.py:606 -msgid "This OpenID is already associated with another account." -msgstr "" - -#: django_authopenid/views.py:611 -#, python-format -msgid "OpenID %s is now associated with your account." -msgstr "" - -#: django_authopenid/views.py:681 -msgid "Account deleted." -msgstr "" - -#: django_authopenid/views.py:721 -msgid "Request for new password" -msgstr "" - -#: django_authopenid/views.py:734 -msgid "A new password has been sent to your email address." -msgstr "" - -#: django_authopenid/views.py:764 -#, python-format -msgid "" -"Could not change password. Confirmation key '%s' is not " -"registered." -msgstr "" - -#: django_authopenid/views.py:773 -msgid "" -"Can not change password. User don't exist anymore in our " -"database." -msgstr "" - -#: django_authopenid/views.py:782 -#, python-format -msgid "Password changed for %s. You may now sign in." -msgstr "" - -#: forum/const.py:8 -msgid "duplicate question" -msgstr "" - -#: forum/const.py:9 -msgid "question if off-topic or not relevant" -msgstr "" - -#: forum/const.py:10 -msgid "too subjective and argumentative" -msgstr "" - -#: forum/const.py:11 -msgid "is not an answer to the question" -msgstr "" - -#: forum/const.py:12 -msgid "the question is answered, right answer was accepted" -msgstr "" - -#: forum/const.py:13 -msgid "problem is not reproducible or outdated" -msgstr "" - -#: forum/const.py:15 -msgid "question contains offensive inappropriate, or malicious remarks" -msgstr "" - -#: forum/const.py:16 -msgid "spam or advertising" -msgstr "" - -#: forum/const.py:56 -msgid "question" -msgstr "" - -#: forum/const.py:57 templates/book.html:110 templates/backup/book.html:110 -msgid "answer" -msgstr "" - -#: forum/const.py:58 -msgid "commented question" -msgstr "" - -#: forum/const.py:59 -msgid "commented answer" -msgstr "" - -#: forum/const.py:60 -msgid "edited question" -msgstr "" - -#: forum/const.py:61 -msgid "edited answer" -msgstr "" - -#: forum/const.py:62 -msgid "received award" -msgstr "" - -#: forum/const.py:63 -msgid "marked best answer" -msgstr "" - -#: forum/const.py:64 -msgid "upvoted" -msgstr "" - -#: forum/const.py:65 -msgid "downvoted" -msgstr "" - -#: forum/const.py:66 -msgid "canceled vote" -msgstr "" - -#: forum/const.py:67 -msgid "deleted question" -msgstr "" - -#: forum/const.py:68 -msgid "deleted answer" -msgstr "" - -#: forum/const.py:69 -msgid "marked offensive" -msgstr "" - -#: forum/const.py:70 -msgid "updated tags" -msgstr "" - -#: forum/const.py:71 -msgid "selected favorite" -msgstr "" - -#: forum/const.py:72 -msgid "completed user profile" -msgstr "" - -#: forum/const.py:83 -msgid "[closed]" -msgstr "" - -#: forum/const.py:84 -msgid "[deleted]" -msgstr "" - -#: forum/const.py:85 -msgid "initial version" -msgstr "" - -#: forum/const.py:86 -msgid "retagged" -msgstr "" - -#: forum/feed.py:17 templates/base.html:7 templates/base_content.html:6 -#: templates/faq.html:25 templates/faq.html.py:108 -#: templates/backup/base.html:7 templates/backup/base_content.html:6 -#: templates/backup/faq.html:25 templates/backup/faq.html.py:108 -#: templates/tough/faq.html:23 templates/tough/faq.html.py:106 -#: templates/tough/question_retag.html:89 -msgid "site title" -msgstr "" - -#: forum/feed.py:17 -msgid " - " -msgstr "" - -#: forum/feed.py:17 templates/base.html:7 templates/base_content.html:6 -#: templates/backup/base.html:7 templates/backup/base_content.html:6 -msgid "site slogan" -msgstr "" - -#: forum/feed.py:17 -msgid "latest questions" -msgstr "" - -#: forum/feed.py:19 templates/index.html:8 templates/backup/index.html:8 -msgid "meta site content" -msgstr "" - -#: forum/feed.py:21 -msgid "copyright message" -msgstr "" - -#: forum/forms.py:14 templates/answer_edit_tips.html:34 -#: templates/answer_edit_tips.html.py:39 templates/question_edit_tips.html:31 -#: templates/question_edit_tips.html:36 -#: templates/backup/answer_edit_tips.html:33 -#: templates/backup/answer_edit_tips.html:38 -#: templates/backup/question_edit_tips.html:29 -#: templates/backup/question_edit_tips.html:34 -msgid "title" -msgstr "" - -#: forum/forms.py:15 -msgid "please enter a descriptive title for your question" -msgstr "" - -#: forum/forms.py:20 -msgid "title must be > 10 characters" -msgstr "" - -#: forum/forms.py:29 -msgid "content" -msgstr "" - -#: forum/forms.py:35 -msgid "question content must be > 10 characters" -msgstr "" - -#: forum/forms.py:45 templates/header.html:30 templates/header.html.py:61 -#: templates/backup/header.html:30 templates/backup/header.html.py:59 -msgid "tags" -msgstr "" - -#: forum/forms.py:46 -msgid "please use space to separate tags (this enables autocomplete feature)" -msgstr "" - -#: forum/forms.py:53 -msgid "tags are required" -msgstr "" - -#: forum/forms.py:57 -msgid "please use 5 tags or less" -msgstr "" - -#: forum/forms.py:60 -msgid "tags must be shorter than 20 characters" -msgstr "" - -#: forum/forms.py:64 -msgid "" -"please use following characters in tags: letters 'a-z', numbers, and " -"characters '.-_#'" -msgstr "" - -#: forum/forms.py:74 templates/index.html:56 templates/question.html:196 -#: templates/question.html.py:377 templates/questions.html:58 -#: templates/questions.html.py:70 templates/unanswered.html:48 -#: templates/unanswered.html.py:60 templates/backup/index.html:56 -#: templates/backup/question.html:195 templates/backup/question.html.py:367 -#: templates/backup/questions.html:57 templates/backup/questions.html.py:69 -#: templates/backup/unanswered.html:47 templates/backup/unanswered.html:59 -#: templates/tough/unanswered.html:46 templates/tough/unanswered.html.py:58 -msgid "community wiki" -msgstr "" - -#: forum/forms.py:75 -msgid "" -"if you choose community wiki option, the question and answer do not generate " -"points and name of author will not be shown" -msgstr "" - -#: forum/forms.py:84 -msgid "update summary:" -msgstr "" - -#: forum/forms.py:85 -msgid "" -"enter a brief summary of your revision (e.g. fixed spelling, grammar, " -"improved style, this field is optional)" -msgstr "" - -#: forum/forms.py:160 -msgid "this email does not have to be linked to gravatar" -msgstr "" - -#: forum/forms.py:161 -msgid "Real name" -msgstr "" - -#: forum/forms.py:162 -msgid "Website" -msgstr "" - -#: forum/forms.py:163 -msgid "Location" -msgstr "" - -#: forum/forms.py:164 -msgid "Date of birth" -msgstr "" - -#: forum/forms.py:164 -msgid "will not be shown, used to calculate age, format: YYYY-MM-DD" -msgstr "" - -#: forum/forms.py:165 templates/authopenid/settings.html:20 -msgid "Profile" -msgstr "" - -#: forum/forms.py:190 forum/forms.py:191 -msgid "this email has already been registered, please use another one" -msgstr "" - -#: forum/models.py:316 templates/badges.html:52 -#: templates/backup/badges.html:52 -msgid "gold" -msgstr "" - -#: forum/models.py:317 templates/badges.html:62 -#: templates/backup/badges.html:62 -msgid "silver" -msgstr "" - -#: forum/models.py:318 templates/badges.html:70 -#: templates/backup/badges.html:70 -msgid "bronze" -msgstr "" - -#: forum/user.py:16 templates/user_tabs.html:7 -#: templates/backup/user_tabs.html:6 -msgid "overview" -msgstr "" - -#: forum/user.py:17 -msgid "user profile" -msgstr "" - -#: forum/user.py:18 -msgid "user profile overview" -msgstr "" - -#: forum/user.py:24 templates/user_tabs.html:9 -#: templates/backup/user_tabs.html:8 -msgid "recent activity" -msgstr "" - -#: forum/user.py:25 -msgid "recent user activity" -msgstr "" - -#: forum/user.py:26 -msgid "profile - recent activity" -msgstr "" - -#: forum/user.py:33 templates/user_tabs.html:13 -#: templates/backup/user_tabs.html:12 -msgid "responses" -msgstr "" - -#: forum/user.py:34 templates/user_tabs.html:12 -#: templates/backup/user_tabs.html:11 -msgid "comments and answers to others questions" -msgstr "" - -#: forum/user.py:35 -msgid "profile - responses" -msgstr "" - -#: forum/user.py:42 templates/user_info.html:23 templates/users.html:26 -#: templates/backup/user_info.html:22 templates/backup/users.html:25 -msgid "reputation" -msgstr "" - -#: forum/user.py:43 -msgid "user reputation in the community" -msgstr "" - -#: forum/user.py:44 -msgid "profile - user reputation" -msgstr "" - -#: forum/user.py:50 -msgid "favorite questions" -msgstr "" - -#: forum/user.py:51 -msgid "users favorite questions" -msgstr "" - -#: forum/user.py:52 -msgid "profile - favorite questions" -msgstr "" - -#: forum/user.py:59 templates/user_tabs.html:20 -#: templates/backup/user_tabs.html:19 -msgid "casted votes" -msgstr "votes" - -#: forum/user.py:60 templates/user_tabs.html:20 -#: templates/backup/user_tabs.html:19 -msgid "user vote record" -msgstr "" - -#: forum/user.py:61 -msgid "profile - votes" -msgstr "" - -#: forum/user.py:68 -msgid "preferences" -msgstr "" - -#: forum/user.py:69 templates/user_tabs.html:28 -#: templates/backup/user_tabs.html:27 -msgid "user preference settings" -msgstr "" - -#: forum/user.py:70 -msgid "profile - user preferences" -msgstr "" - -#: forum/views.py:1730 -msgid "uploading images is limited to users with >60 reputation points" -msgstr "" - -#: forum/views.py:1732 -msgid "allowed file types are 'jpg', 'jpeg', 'gif', 'bmp', 'png', 'tiff'" -msgstr "" - -#: forum/views.py:1734 -#, python-format -msgid "maximum upload file size is %sK" -msgstr "" - -#: forum/views.py:1736 -#, python-format -msgid "" -"Error uploading file. Please contact the site administrator. Thank you. %s" -msgstr "" - -#: forum/templatetags/extra_tags.py:139 forum/templatetags/extra_tags.py:168 -#: templates/header.html:33 templates/backup/header.html:33 -msgid "badges" -msgstr "" - -#: forum/templatetags/extra_tags.py:140 forum/templatetags/extra_tags.py:167 -msgid "reputation points" -msgstr "" - -#: forum/templatetags/extra_tags.py:221 -msgid " ago" -msgstr "" - -#: templates/404.html:24 templates/backup/404.html:24 -msgid "Sorry, could not find the page you requested." -msgstr "" - -#: templates/404.html:26 templates/backup/404.html:26 -msgid "This might have happened for the following reasons:" -msgstr "" - -#: templates/404.html:28 templates/backup/404.html:28 -msgid "this question or answer has been deleted;" -msgstr "" - -#: templates/404.html:29 templates/backup/404.html:29 -msgid "url has error - please check it;" -msgstr "" - -#: templates/404.html:30 templates/backup/404.html:30 -msgid "" -"the page you tried to visit is protected or you don't have sufficient " -"points, see" -msgstr "" - -#: templates/404.html:31 templates/backup/404.html:31 -msgid "if you believe this error 404 should not have occured, please" -msgstr "" - -#: templates/404.html:32 templates/backup/404.html:32 -msgid "report this problem" -msgstr "" - -#: templates/404.html:41 templates/500.html:27 templates/backup/404.html:41 -#: templates/backup/500.html:27 -msgid "back to previous page" -msgstr "" - -#: templates/404.html:42 templates/backup/404.html:42 -msgid "see all questions" -msgstr "" - -#: templates/404.html:43 templates/backup/404.html:43 -msgid "see all tags" -msgstr "" - -#: templates/500.html:24 templates/backup/500.html:24 -msgid "system error log is recorded, error will be fixed as soon as possible" -msgstr "" - -#: templates/500.html:25 templates/backup/500.html:25 -msgid "please report the error to the site administrators if you wish" -msgstr "" - -#: templates/500.html:28 templates/backup/500.html:28 -msgid "see latest questions" -msgstr "" - -#: templates/500.html:29 templates/backup/500.html:29 -msgid "see tags" -msgstr "" - -#: templates/about.html:6 templates/about.html.py:11 -#: templates/backup/about.html:6 templates/backup/about.html.py:11 -msgid "About" -msgstr "" - -#: templates/answer_edit.html:4 templates/answer_edit.html.py:47 -#: templates/backup/answer_edit.html:3 templates/backup/answer_edit.html:46 -msgid "Edit answer" -msgstr "" - -#: templates/answer_edit.html:24 templates/answer_edit.html.py:27 -#: templates/ask.html:25 templates/ask.html.py:28 templates/question.html:37 -#: templates/question.html.py:40 templates/question_edit.html:27 -#: templates/backup/answer_edit.html:23 templates/backup/answer_edit.html:26 -#: templates/backup/ask.html:24 templates/backup/ask.html.py:27 -#: templates/backup/question.html:36 templates/backup/question.html.py:39 -#: templates/backup/question_edit.html:25 -msgid "hide preview" -msgstr "" - -#: templates/answer_edit.html:27 templates/ask.html:28 -#: templates/question.html:40 templates/question_edit.html:27 -#: templates/backup/answer_edit.html:26 templates/backup/ask.html:27 -#: templates/backup/question.html:39 templates/backup/question_edit.html:25 -msgid "show preview" -msgstr "" - -#: templates/answer_edit.html:47 templates/question_edit.html:65 -#: templates/revisions_answer.html:36 templates/revisions_question.html:36 -#: templates/backup/answer_edit.html:46 templates/backup/question_edit.html:63 -#: templates/backup/revisions_answer.html:35 -#: templates/backup/revisions_question.html:34 -#: templates/tough/question_retag.html:51 -msgid "back" -msgstr "" - -#: templates/answer_edit.html:52 templates/question_edit.html:70 -#: templates/revisions_answer.html:47 templates/revisions_question.html:47 -#: templates/backup/answer_edit.html:51 templates/backup/question_edit.html:68 -#: templates/backup/revisions_answer.html:46 -#: templates/backup/revisions_question.html:45 -msgid "revision" -msgstr "" - -#: templates/answer_edit.html:55 templates/question_edit.html:74 -#: templates/backup/answer_edit.html:54 templates/backup/question_edit.html:72 -msgid "select revision" -msgstr "" - -#: templates/answer_edit.html:62 templates/ask.html:81 -#: templates/question.html:447 templates/question_edit.html:91 -#: templates/backup/answer_edit.html:61 templates/backup/ask.html:80 -#: templates/backup/question.html:437 templates/backup/question_edit.html:89 -msgid "Toggle the real time Markdown editor preview" -msgstr "" - -#: templates/answer_edit.html:62 templates/ask.html:81 -#: templates/question.html:447 templates/question_edit.html:91 -#: templates/backup/answer_edit.html:61 templates/backup/ask.html:80 -#: templates/backup/question.html:437 templates/backup/question_edit.html:89 -msgid "toggle preview" -msgstr "" - -#: templates/answer_edit.html:73 templates/question_edit.html:119 -#: templates/backup/answer_edit.html:72 -#: templates/backup/question_edit.html:117 -msgid "Save edit" -msgstr "" - -#: templates/answer_edit.html:74 templates/close.html:29 -#: templates/question_edit.html:120 templates/reopen.html:30 -#: templates/user_edit.html:83 templates/backup/answer_edit.html:73 -#: templates/backup/close.html:29 templates/backup/question_edit.html:118 -#: templates/backup/reopen.html:28 templates/backup/user_edit.html:81 -#: templates/tough/question_retag.html:75 -msgid "Cancel" -msgstr "" - -#: templates/answer_edit_tips.html:4 -msgid "answer tips" -msgstr "Tips" - -#: templates/answer_edit_tips.html:7 templates/backup/answer_edit_tips.html:6 -msgid "please make your answer relevant to this community" -msgstr "" - -#: templates/answer_edit_tips.html:10 templates/backup/answer_edit_tips.html:9 -msgid "try to give an answer, rather than engage into a discussion" -msgstr "" - -#: templates/answer_edit_tips.html:13 -#: templates/backup/answer_edit_tips.html:12 -msgid "please try to provide details" -msgstr "" - -#: templates/answer_edit_tips.html:16 templates/question_edit_tips.html:13 -#: templates/backup/answer_edit_tips.html:15 -#: templates/backup/question_edit_tips.html:11 -msgid "be clear and concise" -msgstr "" - -#: templates/answer_edit_tips.html:19 templates/question_edit_tips.html:16 -#: templates/backup/answer_edit_tips.html:18 -#: templates/backup/question_edit_tips.html:14 -msgid "see frequently asked questions" -msgstr "" - -#: templates/answer_edit_tips.html:25 templates/question_edit_tips.html:22 -#: templates/backup/answer_edit_tips.html:24 -#: templates/backup/question_edit_tips.html:20 -msgid "Markdown tips" -msgstr "Markdown basics" - -#: templates/answer_edit_tips.html:28 templates/question_edit_tips.html:25 -#: templates/backup/answer_edit_tips.html:27 -#: templates/backup/question_edit_tips.html:23 -msgid "*italic* or __italic__" -msgstr "" - -#: templates/answer_edit_tips.html:31 templates/question_edit_tips.html:28 -#: templates/backup/answer_edit_tips.html:30 -#: templates/backup/question_edit_tips.html:26 -msgid "**bold** or __bold__" -msgstr "" - -#: templates/answer_edit_tips.html:34 templates/question_edit_tips.html:31 -#: templates/backup/answer_edit_tips.html:33 -#: templates/backup/question_edit_tips.html:29 -msgid "link" -msgstr "" - -#: templates/answer_edit_tips.html:34 templates/answer_edit_tips.html.py:39 -#: templates/question_edit_tips.html:31 templates/question_edit_tips.html:36 -#: templates/backup/answer_edit_tips.html:33 -#: templates/backup/answer_edit_tips.html:38 -#: templates/backup/question_edit_tips.html:29 -#: templates/backup/question_edit_tips.html:34 -msgid "text" -msgstr "" - -#: templates/answer_edit_tips.html:39 templates/question_edit_tips.html:36 -#: templates/backup/answer_edit_tips.html:38 -#: templates/backup/question_edit_tips.html:34 -msgid "image" -msgstr "" - -#: templates/answer_edit_tips.html:43 templates/question_edit_tips.html:40 -#: templates/backup/answer_edit_tips.html:42 -#: templates/backup/question_edit_tips.html:38 -msgid "numbered list:" -msgstr "" - -#: templates/answer_edit_tips.html:48 templates/question_edit_tips.html:45 -#: templates/backup/answer_edit_tips.html:47 -#: templates/backup/question_edit_tips.html:43 -msgid "basic HTML tags are also supported" -msgstr "" - -#: templates/answer_edit_tips.html:51 templates/question_edit_tips.html:48 -#: templates/backup/answer_edit_tips.html:50 -#: templates/backup/question_edit_tips.html:46 -msgid "learn more about Markdown" -msgstr "" - -#: templates/ask.html:4 templates/ask.html.py:60 templates/backup/ask.html:3 -#: templates/backup/ask.html.py:59 -msgid "Ask a question" -msgstr "" - -#: templates/ask.html:106 templates/backup/ask.html:105 -msgid "Use" -msgstr "" - -#: templates/ask.html:106 templates/backup/ask.html:105 -msgid "learn more about OpenID" -msgstr "" - -#: templates/ask.html:106 templates/authopenid/signin.html:34 -#: templates/authopenid/signin.html:60 templates/backup/ask.html:105 -msgid "Login" -msgstr "" - -#: templates/ask.html:109 templates/backup/ask.html:108 -msgid "Get your own " -msgstr "" - -#: templates/ask.html:117 templates/authopenid/sendpw.html:27 -#: templates/backup/ask.html:116 -msgid "User name" -msgstr "" - -#: templates/ask.html:120 templates/backup/ask.html:119 -msgid "Email: (won't be shown to anyone)" -msgstr "" - -#: templates/ask.html:127 templates/backup/ask.html:126 -msgid "Ask your question" -msgstr "" - -#: templates/badge.html:6 templates/badge.html.py:17 -#: templates/backup/badge.html:5 templates/backup/badge.html.py:16 -msgid "Badge" -msgstr "" - -#: templates/badge.html:26 templates/backup/badge.html:25 -msgid "The users have been awarded with badges:" -msgstr "" - -#: templates/badges.html:6 templates/backup/badges.html:6 -msgid "Badges summary" -msgstr "" - -#: templates/badges.html:17 templates/user_stats.html:113 -#: templates/backup/badges.html:17 templates/backup/user_stats.html:112 -msgid "Badges" -msgstr "" - -#: templates/badges.html:21 templates/backup/badges.html:21 -msgid "Community gives you awards for your questions, answers and votes." -msgstr "" - -#: templates/badges.html:22 templates/backup/badges.html:22 -msgid "" -"Below is the list of available badges and number of times each type of badge " -"has been awarded." -msgstr "" - -#: templates/badges.html:49 templates/backup/badges.html:49 -msgid "Community badges" -msgstr "" - -#: templates/badges.html:55 templates/backup/badges.html:55 -msgid "Gold badge is very rare." -msgstr "" - -#: templates/badges.html:56 templates/backup/badges.html:56 -msgid "" -"To obtain it you have to show profound knowledge and ability in addition to " -"actively participating in the community." -msgstr "" - -#: templates/badges.html:57 templates/backup/badges.html:57 -msgid "Gold badge is the highest award in this community." -msgstr "" - -#: templates/badges.html:65 templates/backup/badges.html:65 -msgid "Obtaining silver badge requires significant patience." -msgstr "" - -#: templates/badges.html:66 templates/backup/badges.html:66 -msgid "If you got one, you've very significantly contributed to this community" -msgstr "" - -#: templates/badges.html:69 templates/backup/badges.html:69 -msgid "bronze badge: often given as a special honor" -msgstr "" - -#: templates/badges.html:73 templates/backup/badges.html:73 -msgid "" -"If you are active in this community, you will will get this medal - still it " -"is a special honor." -msgstr "" - -#: templates/base.html:59 templates/base_content.html:60 -#: templates/backup/base.html:59 templates/backup/base_content.html:57 -msgid "congratulations, community gave you a badge" -msgstr "" - -#: templates/base.html:61 templates/base_content.html:62 -#: templates/backup/base.html:61 templates/backup/base_content.html:59 -msgid "profile" -msgstr "" - -#: templates/base_content.html:61 templates/backup/base_content.html:58 -msgid "see" -msgstr "" - -#: templates/book.html:7 templates/backup/book.html:7 -msgid "reading channel" -msgstr "" - -#: templates/book.html:26 templates/backup/book.html:26 -msgid "[author]" -msgstr "" - -#: templates/book.html:30 templates/backup/book.html:30 -msgid "[publisher]" -msgstr "" - -#: templates/book.html:34 templates/backup/book.html:34 -msgid "[publication date]" -msgstr "" - -#: templates/book.html:38 templates/backup/book.html:38 -msgid "[price]" -msgstr "" - -#: templates/book.html:39 templates/backup/book.html:39 -msgid "currency unit" -msgstr "" - -#: templates/book.html:42 templates/backup/book.html:42 -msgid "[pages]" -msgstr "" - -#: templates/book.html:43 templates/backup/book.html:43 -msgid "pages abbreviation" -msgstr "" - -#: templates/book.html:46 templates/backup/book.html:46 -msgid "[tags]" -msgstr "" - -#: templates/book.html:56 templates/backup/book.html:56 -msgid "author blog" -msgstr "" - -#: templates/book.html:62 templates/backup/book.html:62 -msgid "book directory" -msgstr "" - -#: templates/book.html:66 templates/backup/book.html:66 -msgid "buy online" -msgstr "" - -#: templates/book.html:79 templates/backup/book.html:79 -msgid "reader questions" -msgstr "" - -#: templates/book.html:82 templates/backup/book.html:82 -msgid "ask the author" -msgstr "" - -#: templates/book.html:88 templates/book.html.py:93 -#: templates/users_questions.html:17 templates/backup/book.html:88 -#: templates/backup/book.html.py:93 templates/backup/users_questions.html:16 -msgid "this question was selected as favorite" -msgstr "" - -#: templates/book.html:88 templates/book.html.py:93 -#: templates/users_questions.html:11 templates/users_questions.html.py:17 -#: templates/backup/book.html:88 templates/backup/book.html.py:93 -#: templates/backup/users_questions.html:10 -#: templates/backup/users_questions.html:16 -msgid "number of times" -msgstr "" - -#: templates/book.html:105 templates/index.html:47 templates/questions.html:46 -#: templates/unanswered.html:37 templates/users_questions.html:30 -#: templates/backup/book.html:105 templates/backup/index.html:47 -#: templates/backup/questions.html:45 templates/backup/unanswered.html:36 -#: templates/backup/users_questions.html:29 templates/tough/unanswered.html:35 -msgid "votes" -msgstr "" - -#: templates/book.html:108 templates/backup/book.html:108 -msgid "the answer has been accepted to be correct" -msgstr "" - -#: templates/book.html:115 templates/index.html:48 templates/questions.html:47 -#: templates/unanswered.html:38 templates/users_questions.html:40 -#: templates/backup/book.html:115 templates/backup/index.html:48 -#: templates/backup/questions.html:46 templates/backup/unanswered.html:37 -#: templates/backup/users_questions.html:39 templates/tough/unanswered.html:36 -msgid "views" -msgstr "" - -#: templates/book.html:125 templates/index.html:68 templates/question.html:112 -#: templates/question.html.py:479 templates/questions.html:84 -#: templates/questions.html.py:149 templates/tags.html:47 -#: templates/unanswered.html:75 templates/unanswered.html.py:109 -#: templates/users_questions.html:52 templates/backup/book.html:125 -#: templates/backup/index.html:68 templates/backup/index.html.py:93 -#: templates/backup/question.html:111 templates/backup/question.html.py:469 -#: templates/backup/questions.html:83 templates/backup/questions.html:148 -#: templates/backup/tags.html:46 templates/backup/unanswered.html:74 -#: templates/backup/unanswered.html:108 -#: templates/backup/users_questions.html:51 templates/tough/unanswered.html:72 -#: templates/tough/unanswered.html:105 -msgid "using tags" -msgstr "" - -#: templates/book.html:147 templates/backup/book.html:147 -msgid "subscribe to book RSS feed" -msgstr "" - -#: templates/book.html:147 templates/index.html:116 -#: templates/backup/book.html:147 templates/backup/index.html:115 -msgid "subscribe to the questions feed" -msgstr "" - -#: templates/close.html:6 templates/close.html.py:16 -#: templates/backup/close.html:6 templates/backup/close.html.py:16 -msgid "Close question" -msgstr "" - -#: templates/close.html:19 templates/backup/close.html:19 -msgid "Close the question" -msgstr "" - -#: templates/close.html:25 templates/backup/close.html:25 -msgid "Reasons" -msgstr "" - -#: templates/close.html:28 templates/backup/close.html:28 -msgid "OK to close" -msgstr "" - -#: templates/faq.html:11 templates/backup/faq.html:11 -#: templates/tough/faq.html:9 -msgid "Frequently Asked Questions " -msgstr "" - -#: templates/faq.html:15 templates/backup/faq.html:15 -#: templates/tough/faq.html:13 -msgid "What kinds of questions can I ask here?" -msgstr "" - -#: templates/faq.html:16 templates/backup/faq.html:16 -#: templates/tough/faq.html:14 -msgid "" -"Most importanly - questions should be relevant to this " -"community." -msgstr "" - -#: templates/faq.html:17 templates/backup/faq.html:17 -#: templates/tough/faq.html:15 -msgid "" -"Before asking the question - please make sure to use search to see whether " -"your question has alredy been answered." -msgstr "" - -#: templates/faq.html:20 templates/backup/faq.html:20 -#: templates/tough/faq.html:18 -msgid "What questions should I avoid asking?" -msgstr "" - -#: templates/faq.html:21 templates/backup/faq.html:21 -#: templates/tough/faq.html:19 -msgid "" -"Please avoid asking questions that are not relevant to this community, too " -"subjective and argumentative." -msgstr "" - -#: templates/faq.html:24 templates/backup/faq.html:24 -#: templates/tough/faq.html:22 -msgid "What should I avoid in my answers?" -msgstr "" - -#: templates/faq.html:25 templates/backup/faq.html:25 -#: templates/tough/faq.html:23 -msgid "" -"is a Q&A site, not a discussion group. Therefore - please avoid having " -"discussions in your answers, comment facility allows some space for brief " -"discussions." -msgstr "" - -#: templates/faq.html:28 templates/backup/faq.html:28 -#: templates/tough/faq.html:26 -msgid "Who moderates this community?" -msgstr "" - -#: templates/faq.html:29 templates/backup/faq.html:29 -#: templates/tough/faq.html:27 -msgid "The short answer is: you." -msgstr "" - -#: templates/faq.html:30 templates/backup/faq.html:30 -#: templates/tough/faq.html:28 -msgid "This website is moderated by the users." -msgstr "" - -#: templates/faq.html:31 templates/backup/faq.html:31 -#: templates/tough/faq.html:29 -msgid "" -"The reputation system allows users earn the authorization to perform a " -"variety of moderation tasks." -msgstr "" - -#: templates/faq.html:34 templates/backup/faq.html:34 -#: templates/tough/faq.html:32 -msgid "How does reputation system work?" -msgstr "" - -#: templates/faq.html:35 templates/backup/faq.html:35 -#: templates/tough/faq.html:33 -msgid "" -"Anyone can ask questions and give answers, points are not necessary for that." -msgstr "" - -#: templates/faq.html:36 templates/backup/faq.html:36 -#: templates/tough/faq.html:34 -msgid "" -"As we've said before, users help running this site. Point system helps " -"select users who can administer this community." -msgstr "" - -#: templates/faq.html:37 templates/backup/faq.html:37 -#: templates/tough/faq.html:35 -msgid "" -"Reputation points roughly measure how community trusts you. These points are " -"given to you directly by other members of the community." -msgstr "" - -#: templates/faq.html:40 templates/backup/faq.html:40 -#: templates/tough/faq.html:38 -msgid "" -"For example, if you ask an interesting question or give a helpful answer, " -"your input will be upvoted and you will gain more trust in the community." -msgstr "" - -#: templates/faq.html:41 templates/backup/faq.html:41 -#: templates/tough/faq.html:39 -msgid "" -"If on the other hand someone gives a misleading answer, the answer will be " -"voted down and he/she loses some points." -msgstr "" - -#: templates/faq.html:42 templates/backup/faq.html:42 -#: templates/tough/faq.html:40 -msgid "" -"Each vote in favor will generate 10 points, each vote " -"against will subtract 2 points." -msgstr "" - -#: templates/faq.html:43 templates/backup/faq.html:43 -#: templates/tough/faq.html:41 -msgid "" -"Through the votes of other people you can accumulate a maximum of " -"200 points." -msgstr "" - -#: templates/faq.html:44 templates/backup/faq.html:44 -msgid "After accumulating certain number of points, you can do more:" -msgstr "" - -#: templates/faq.html:52 templates/user_votes.html:14 -#: templates/backup/faq.html:52 templates/backup/user_votes.html:13 -#: templates/tough/faq.html:50 -msgid "upvote" -msgstr "" - -#: templates/faq.html:56 templates/backup/faq.html:56 -#: templates/tough/faq.html:54 -msgid "use tags" -msgstr "" - -#: templates/faq.html:60 templates/backup/faq.html:60 -#: templates/tough/faq.html:58 -msgid "add comments" -msgstr "" - -#: templates/faq.html:64 templates/user_votes.html:16 -#: templates/backup/faq.html:64 templates/backup/user_votes.html:15 -#: templates/tough/faq.html:62 -msgid "downvote" -msgstr "" - -#: templates/faq.html:71 templates/backup/faq.html:71 -#: templates/tough/faq.html:69 -msgid "retag questions" -msgstr "" - -#: templates/faq.html:75 templates/backup/faq.html:75 -#: templates/tough/faq.html:73 -msgid "edit community wiki questions" -msgstr "" - -#: templates/faq.html:79 templates/backup/faq.html:79 -#: templates/tough/faq.html:77 -msgid "edit any answer" -msgstr "" - -#: templates/faq.html:83 templates/backup/faq.html:83 -#: templates/tough/faq.html:81 -msgid "open any closed question" -msgstr "" - -#: templates/faq.html:87 templates/backup/faq.html:87 -#: templates/tough/faq.html:85 -msgid "delete any comment" -msgstr "" - -#: templates/faq.html:91 templates/backup/faq.html:91 -#: templates/tough/faq.html:89 -msgid "delete any questions and answers and perform other moderation tasks" -msgstr "" - -#: templates/faq.html:98 templates/backup/faq.html:98 -msgid "To register, do I need to create new password?" -msgstr "" - -#: templates/faq.html:99 templates/backup/faq.html:99 -#: templates/tough/faq.html:97 -msgid "" -"No, you don't have to. You can login through any service that supports " -"OpenID, e.g. Google, Yahoo, AOL, etc." -msgstr "" - -#: templates/faq.html:100 templates/backup/faq.html:100 -#: templates/tough/faq.html:98 -msgid "Login now!" -msgstr "" - -#: templates/faq.html:103 templates/backup/faq.html:103 -#: templates/tough/faq.html:101 -msgid "Why other people can edit my questions/answers?" -msgstr "" - -#: templates/faq.html:104 templates/backup/faq.html:104 -#: templates/tough/faq.html:102 -msgid "Goal of this site is..." -msgstr "" - -#: templates/faq.html:104 templates/backup/faq.html:104 -#: templates/tough/faq.html:102 -msgid "" -"So questions and answers can be edited like wiki pages by experienced users " -"of this site and this improves the overall quality of the knowledge base " -"content." -msgstr "" - -#: templates/faq.html:105 templates/backup/faq.html:105 -#: templates/tough/faq.html:103 -msgid "If this approach is not for you, we respect your choice." -msgstr "" - -#: templates/faq.html:107 templates/backup/faq.html:107 -#: templates/tough/faq.html:105 -msgid "Still have questions?" -msgstr "" - -#: templates/faq.html:108 templates/backup/faq.html:108 -msgid "Please ask your question, help make our community better!" -msgstr "" - -#: templates/faq.html:108 templates/header.html:29 templates/header.html.py:60 -#: templates/backup/faq.html:108 templates/backup/header.html:29 -#: templates/backup/header.html.py:58 templates/tough/faq.html:106 -msgid "questions" -msgstr "" - -#: templates/faq.html:108 templates/index.html:121 -#: templates/backup/faq.html:108 templates/backup/index.html:120 -#: templates/tough/faq.html:106 -msgid "." -msgstr "" - -#: templates/footer.html:7 templates/header.html:12 templates/index.html:83 -#: templates/backup/footer.html:7 templates/backup/header.html:12 -#: templates/backup/index.html:83 -msgid "about" -msgstr "" - -#: templates/footer.html:8 templates/header.html:13 templates/index.html:84 -#: templates/backup/footer.html:8 templates/backup/header.html:13 -#: templates/backup/index.html:84 -msgid "faq" -msgstr "" - -#: templates/footer.html:9 templates/backup/footer.html:9 -msgid "blog" -msgstr "" - -#: templates/footer.html:10 templates/backup/footer.html:10 -msgid "contact us" -msgstr "" - -#: templates/footer.html:11 templates/backup/footer.html:11 -msgid "privacy policy" -msgstr "" - -#: templates/footer.html:12 templates/backup/footer.html:12 -msgid "give feedback" -msgstr "" - -#: templates/footer.html:18 templates/backup/footer.html:18 -msgid "current revision" -msgstr "" - -#: templates/header.html:8 templates/backup/header.html:8 -msgid "logout" -msgstr "" - -#: templates/header.html:10 templates/authopenid/signup.html:39 -#: templates/backup/header.html:10 -msgid "login" -msgstr "" - -#: templates/header.html:23 templates/backup/header.html:23 -msgid "back to home page" -msgstr "" - -#: templates/header.html:31 templates/header.html.py:62 -#: templates/backup/header.html:31 templates/backup/header.html.py:60 -msgid "users" -msgstr "" - -#: templates/header.html:32 templates/backup/header.html:32 -msgid "books" -msgstr "" - -#: templates/header.html:34 templates/index.html:121 -#: templates/backup/header.html:34 templates/backup/index.html:120 -msgid "unanswered questions" -msgstr "unanswered" - -#: templates/header.html:38 templates/backup/header.html:37 -msgid "my profile" -msgstr "" - -#: templates/header.html:42 templates/backup/header.html:40 -msgid "ask a question" -msgstr "" - -#: templates/header.html:57 templates/backup/header.html:55 -msgid "search" -msgstr "" - -#: templates/index.html:6 templates/backup/index.html:6 -msgid "Home" -msgstr "" - -#: templates/index.html:7 templates/backup/index.html:7 -msgid "meta site keywords, comma separated" -msgstr "" - -#: templates/index.html:21 templates/questions.html:7 -#: templates/backup/index.html:21 templates/backup/questions.html:6 -msgid "Questions" -msgstr "" - -#: templates/index.html:23 templates/backup/index.html:23 -msgid "last updated questions" -msgstr "" - -#: templates/index.html:23 templates/questions.html:25 -#: templates/unanswered.html:20 templates/backup/index.html:23 -#: templates/backup/questions.html:24 templates/backup/unanswered.html:19 -#: templates/tough/unanswered.html:18 -msgid "newest" -msgstr "" - -#: templates/index.html:24 templates/questions.html:27 -#: templates/backup/index.html:24 templates/backup/questions.html:26 -msgid "hottest questions" -msgstr "" - -#: templates/index.html:24 templates/questions.html:27 -#: templates/backup/index.html:24 templates/backup/questions.html:26 -msgid "hottest" -msgstr "" - -#: templates/index.html:25 templates/questions.html:28 -#: templates/backup/index.html:25 templates/backup/questions.html:27 -msgid "most voted questions" -msgstr "" - -#: templates/index.html:25 templates/questions.html:28 -#: templates/backup/index.html:25 templates/backup/questions.html:27 -msgid "most voted" -msgstr "" - -#: templates/index.html:26 templates/backup/index.html:26 -msgid "all questions" -msgstr "" - -#: templates/index.html:46 templates/questions.html:45 -#: templates/unanswered.html:36 templates/users_questions.html:35 -#: templates/backup/index.html:46 templates/backup/questions.html:44 -#: templates/backup/unanswered.html:35 -#: templates/backup/users_questions.html:34 templates/tough/unanswered.html:34 -msgid "answers" -msgstr "" - -#: templates/index.html:68 templates/question.html:112 -#: templates/question.html.py:479 templates/questions.html:84 -#: templates/questions.html.py:149 templates/tags.html:47 -#: templates/unanswered.html:75 templates/unanswered.html.py:109 -#: templates/users_questions.html:52 templates/backup/index.html:68 -#: templates/backup/index.html.py:93 templates/backup/question.html:111 -#: templates/backup/question.html.py:469 templates/backup/questions.html:83 -#: templates/backup/questions.html:148 templates/backup/tags.html:46 -#: templates/backup/unanswered.html:74 templates/backup/unanswered.html:108 -#: templates/backup/users_questions.html:51 templates/tough/unanswered.html:72 -#: templates/tough/unanswered.html:105 -msgid "see questions tagged" -msgstr "" - -#: templates/index.html:79 templates/backup/index.html:79 -msgid "welcome to website" -msgstr "" - -#: templates/index.html:81 templates/backup/index.html:81 -msgid "what is this website" -msgstr "" - -#: templates/index.html:82 templates/backup/index.html:82 -msgid "what can one do on this website" -msgstr "" - -#: templates/index.html:89 templates/backup/index.html:89 -msgid "Recent tags" -msgstr "" - -#: templates/index.html:94 -#, python-format -msgid "see questions tagged '%(tagname)s'" -msgstr "" - -#: templates/index.html:97 templates/index.html.py:121 -#: templates/backup/index.html:96 templates/backup/index.html.py:120 -msgid "popular tags" -msgstr "" - -#: templates/index.html:101 templates/backup/index.html:100 -msgid "Recent awards" -msgstr "" - -#: templates/index.html:107 templates/backup/index.html:106 -msgid "given to" -msgstr "" - -#: templates/index.html:112 templates/backup/index.html:111 -msgid "all awards" -msgstr "" - -#: templates/index.html:116 templates/backup/index.html:115 -msgid "subscribe to last 30 questions by RSS" -msgstr "" - -#: templates/index.html:121 templates/backup/index.html:120 -msgid "Still looking for more? See" -msgstr "" - -#: templates/index.html:121 templates/backup/index.html:120 -msgid "complete list of quesionts" -msgstr "" - -#: templates/index.html:121 templates/backup/index.html:120 -msgid "or" -msgstr "" - -#: templates/index.html:121 templates/backup/index.html:120 -msgid "Please help us answer" -msgstr "" - -#: templates/logout.html:6 templates/logout.html.py:17 -#: templates/backup/logout.html:6 templates/backup/logout.html.py:17 -msgid "Logout" -msgstr "" - -#: templates/logout.html:20 templates/backup/logout.html:20 -msgid "" -"As a registered user you can login with your OpenID, log out of the site or " -"permanently remove your account." -msgstr "" - -#: templates/logout.html:21 templates/backup/logout.html:21 -msgid "Logout now" -msgstr "" - -#: templates/pagesize.html:6 templates/backup/pagesize.html:6 -msgid "posts per page" -msgstr "" - -#: templates/paginator.html:6 templates/paginator.html.py:7 -#: templates/backup/paginator.html:5 templates/backup/paginator.html.py:6 -msgid "previous" -msgstr "" - -#: templates/paginator.html:20 templates/backup/paginator.html:19 -msgid "current page" -msgstr "" - -#: templates/paginator.html:23 templates/paginator.html.py:30 -#: templates/backup/paginator.html:22 templates/backup/paginator.html.py:29 -msgid "page number " -msgstr "" - -#: templates/paginator.html:23 templates/paginator.html.py:30 -#: templates/backup/paginator.html:22 templates/backup/paginator.html.py:29 -msgid "number - make blank in english" -msgstr "" - -#: templates/paginator.html:34 templates/backup/paginator.html:33 -msgid "next page" -msgstr "" - -#: templates/privacy.html:6 templates/privacy.html.py:11 -#: templates/backup/privacy.html:5 templates/backup/privacy.html.py:10 -msgid "Privacy policy" -msgstr "" - -#: templates/privacy.html:15 templates/backup/privacy.html:14 -msgid "general message about privacy" -msgstr "" - -#: templates/privacy.html:18 templates/backup/privacy.html:17 -msgid "Site Visitors" -msgstr "" - -#: templates/privacy.html:20 templates/backup/privacy.html:19 -msgid "what technical information is collected about visitors" -msgstr "" - -#: templates/privacy.html:23 templates/backup/privacy.html:22 -msgid "Personal Information" -msgstr "" - -#: templates/privacy.html:25 templates/backup/privacy.html:24 -msgid "details on personal information policies" -msgstr "" - -#: templates/privacy.html:28 templates/backup/privacy.html:27 -msgid "Other Services" -msgstr "" - -#: templates/privacy.html:30 templates/backup/privacy.html:29 -msgid "details on sharing data with third parties" -msgstr "" - -#: templates/privacy.html:35 templates/backup/privacy.html:34 -msgid "cookie policy details" -msgstr "" - -#: templates/privacy.html:37 templates/backup/privacy.html:36 -msgid "Policy Changes" -msgstr "" - -#: templates/privacy.html:38 templates/backup/privacy.html:37 -msgid "how privacy policies can be changed" -msgstr "" - -#: templates/question.html:66 templates/question.html.py:78 -#: templates/backup/question.html:65 templates/backup/question.html.py:77 -msgid "i like this post (click again to cancel)" -msgstr "" - -#: templates/question.html:68 templates/question.html.py:80 -#: templates/question.html:273 templates/backup/question.html:67 -#: templates/backup/question.html.py:79 templates/backup/question.html:272 -msgid "current number of votes" -msgstr "" - -#: templates/question.html:73 templates/question.html.py:84 -#: templates/backup/question.html:72 templates/backup/question.html.py:83 -msgid "i dont like this post (click again to cancel)" -msgstr "" - -#: templates/question.html:90 templates/backup/question.html:89 -msgid "mark this question as favorite (click again to cancel)" -msgstr "" - -#: templates/question.html:96 templates/backup/question.html:95 -msgid "remove favorite mark from this question (click again to restore mark)" -msgstr "" - -#: templates/question.html:121 templates/question.html.py:304 -#: templates/revisions_answer.html:53 templates/revisions_question.html:53 -#: templates/backup/question.html:120 templates/backup/question.html.py:303 -#: templates/backup/revisions_answer.html:52 -#: templates/backup/revisions_question.html:51 -msgid "edit" -msgstr "" - -#: templates/question.html:125 templates/question.html.py:314 -#: templates/backup/question.html:124 templates/backup/question.html.py:307 -msgid "delete" -msgstr "" - -#: templates/question.html:130 templates/backup/question.html:129 -msgid "reopen" -msgstr "" - -#: templates/question.html:135 templates/backup/question.html:134 -msgid "close" -msgstr "" - -#: templates/question.html:141 templates/question.html.py:327 -#: templates/backup/question.html:140 templates/backup/question.html.py:317 -msgid "" -"report as offensive (i.e containing spam, advertising, malicious text, etc.)" -msgstr "" - -#: templates/question.html:142 templates/question.html.py:328 -#: templates/backup/question.html:141 templates/backup/question.html.py:318 -msgid "flag offensive" -msgstr "" - -#: templates/question.html:154 templates/question.html.py:337 -#: templates/revisions_answer.html:65 templates/revisions_question.html:65 -#: templates/backup/question.html:153 templates/backup/question.html.py:327 -#: templates/backup/revisions_answer.html:64 -#: templates/backup/revisions_question.html:63 -msgid "updated" -msgstr "" - -#: templates/question.html:203 templates/question.html.py:384 -#: templates/revisions_answer.html:63 templates/revisions_question.html:63 -#: templates/backup/question.html:202 templates/backup/question.html.py:374 -#: templates/backup/revisions_answer.html:62 -#: templates/backup/revisions_question.html:61 -msgid "asked" -msgstr "" - -#: templates/question.html:233 templates/question.html.py:411 -#: templates/backup/question.html:232 templates/backup/question.html.py:401 -msgid "comments" -msgstr "" - -#: templates/question.html:234 templates/question.html.py:412 -#: templates/backup/question.html:233 templates/backup/question.html.py:402 -msgid "add comment" -msgstr "" - -#: templates/question.html:247 templates/backup/question.html:246 -#, python-format -msgid "" -"The question has been closed for the following reason \"%(question." -"get_close_reason_display)s\" by" -msgstr "" - -#: templates/question.html:249 templates/backup/question.html:248 -#, python-format -msgid "close date %(question.closed_at)s" -msgstr "" - -#: templates/question.html:256 templates/user_stats.html:28 -#: templates/backup/question.html:255 templates/backup/user_stats.html:27 -msgid "Answers" -msgstr " Answers" - -#: templates/question.html:258 templates/backup/question.html:257 -msgid "oldest answers will be shown first" -msgstr "" - -#: templates/question.html:258 templates/backup/question.html:257 -msgid "oldest answers" -msgstr "oldest" - -#: templates/question.html:259 templates/backup/question.html:258 -msgid "newest answers will be shown first" -msgstr "" - -#: templates/question.html:259 templates/backup/question.html:258 -msgid "newest answers" -msgstr "newest" - -#: templates/question.html:260 templates/backup/question.html:259 -msgid "most voted answers will be shown first" -msgstr "" - -#: templates/question.html:260 templates/backup/question.html:259 -msgid "popular answers" -msgstr "most voted" - -#: templates/question.html:272 templates/backup/question.html:271 -msgid "i like this answer (click again to cancel)" -msgstr "" - -#: templates/question.html:278 templates/backup/question.html:277 -msgid "i dont like this answer (click again to cancel)" -msgstr "" - -#: templates/question.html:284 templates/backup/question.html:283 -msgid "mark this answer as favorite (click again to undo)" -msgstr "" - -#: templates/question.html:289 templates/backup/question.html:288 -msgid "the author of the question has selected this answer as correct" -msgstr "" - -#: templates/question.html:311 -msgid "undelete" -msgstr "" - -#: templates/question.html:321 templates/backup/question.html:311 -msgid "answer permanent link" -msgstr "" - -#: templates/question.html:322 templates/backup/question.html:312 -msgid "permanent link" -msgstr "" - -#: templates/question.html:436 templates/backup/question.html:426 -msgid "Your answer" -msgstr "" - -#: templates/question.html:460 templates/backup/question.html:450 -msgid "Answer the question" -msgstr "" - -#: templates/question.html:462 templates/backup/question.html:452 -msgid "Login to answer" -msgstr "" - -#: templates/question.html:474 templates/backup/question.html:464 -msgid "Question tags" -msgstr "Tags" - -#: templates/question.html:484 templates/backup/question.html:474 -msgid "question asked" -msgstr "Asked" - -#: templates/question.html:484 templates/question.html.py:490 -#: templates/user_info.html:51 templates/backup/question.html:474 -#: templates/backup/question.html.py:480 templates/backup/user_info.html:50 -msgid "ago" -msgstr "" - -#: templates/question.html:487 templates/backup/question.html:477 -msgid "question was seen" -msgstr "Seen" - -#: templates/question.html:487 templates/backup/question.html:477 -msgid "times" -msgstr "" - -#: templates/question.html:490 templates/backup/question.html:480 -msgid "last updated" -msgstr "Last updated" - -#: templates/question.html:495 templates/backup/question.html:485 -msgid "Related questions" -msgstr "" - -#: templates/question_edit.html:4 templates/question_edit.html.py:65 -#: templates/backup/question_edit.html:2 -#: templates/backup/question_edit.html:63 -msgid "Edit question" -msgstr "" - -#: templates/question_edit_tips.html:4 -msgid "question tips" -msgstr "Tips" - -#: templates/question_edit_tips.html:7 -#: templates/backup/question_edit_tips.html:5 -msgid "please ask a relevant question" -msgstr "" - -#: templates/question_edit_tips.html:10 -#: templates/backup/question_edit_tips.html:8 -msgid "please try provide enough details" -msgstr "provide enough details" - -#: templates/questions.html:23 templates/backup/questions.html:22 -msgid "Found by tags" -msgstr "Tagged questions" - -#: templates/questions.html:23 templates/backup/questions.html:22 -msgid "Found by title" -msgstr "" - -#: templates/questions.html:23 templates/backup/questions.html:22 -msgid "All questions" -msgstr "" - -#: templates/questions.html:25 templates/unanswered.html:20 -#: templates/backup/questions.html:24 templates/backup/unanswered.html:19 -#: templates/tough/unanswered.html:18 -msgid "most recently asked questions" -msgstr "" - -#: templates/questions.html:26 templates/backup/questions.html:25 -msgid "most recently updated questions" -msgstr "" - -#: templates/questions.html:26 templates/backup/questions.html:25 -msgid "active" -msgstr "" - -#: templates/questions.html:109 -#, python-format -msgid "" -"\n" -"\t\t\thave total %(q_num)s questions tagged %(tagname)s\n" -"\t\t\t" -msgid_plural "" -"\n" -"\t\t\thave total %(q_num)s questions tagged %(tagname)s\n" -"\t\t\t" -msgstr[0] "" -"\n" -"
%(q_num)s

question tagged

%(tagname)s

" -msgstr[1] "" -"\n" -"
%(q_num)s

questions tagged

%(tagname)s

" - -#: templates/questions.html:116 -#, python-format -msgid "" -"\n" -"\t\t\thave total %(q_num)s questions containing %(searchtitle)s\n" -"\t\t\t" -msgid_plural "" -"\n" -"\t\t\thave total %(q_num)s questions containing %(searchtitle)s\n" -"\t\t\t" -msgstr[0] "" -"\n" -"
%(q_num)s

question with title " -"containing %(searchtitle)s" -msgstr[1] "" -"\n" -"

%(q_num)s

questions with title " -"containing %(searchtitle)s" - -#: templates/questions.html:124 -msgid "latest questions info" -msgstr "Newest questions are shown first." - -#: templates/questions.html:128 templates/backup/questions.html:127 -msgid "Questions are sorted by the time of last update." -msgstr "" - -#: templates/questions.html:129 templates/backup/questions.html:128 -msgid "Most recently answered ones are shown first." -msgstr "" - -#: templates/questions.html:133 templates/backup/questions.html:132 -msgid "Questions sorted by number of responses." -msgstr "" - -#: templates/questions.html:134 templates/backup/questions.html:133 -msgid "Most answered questions are shown first." -msgstr "" - -#: templates/questions.html:138 templates/backup/questions.html:137 -msgid "Questions are sorted by the number of votes." -msgstr "" - -#: templates/questions.html:139 templates/backup/questions.html:138 -msgid "Most voted questions are shown first." -msgstr "" - -#: templates/questions.html:146 templates/unanswered.html:105 -#: templates/backup/questions.html:145 templates/backup/unanswered.html:104 -#: templates/tough/unanswered.html:101 -msgid "Related tags" -msgstr "Tags" - -#: templates/reopen.html:6 templates/reopen.html.py:16 -#: templates/backup/reopen.html:4 templates/backup/reopen.html.py:14 -msgid "Reopen question" -msgstr "" - -#: templates/reopen.html:19 templates/backup/reopen.html:17 -msgid "Open the previously closed question" -msgstr "" - -#: templates/reopen.html:22 templates/backup/reopen.html:20 -msgid "The question was closed for the following reason " -msgstr "" - -#: templates/reopen.html:22 templates/backup/reopen.html:20 -msgid "reason - leave blank in english" -msgstr "" - -#: templates/reopen.html:22 templates/backup/reopen.html:20 -msgid "on " -msgstr "" - -#: templates/reopen.html:22 templates/backup/reopen.html:20 -msgid "date closed" -msgstr "" - -#: templates/reopen.html:29 templates/backup/reopen.html:27 -msgid "Reopen this question" -msgstr "" - -#: templates/revisions_answer.html:7 templates/revisions_answer.html.py:36 -#: templates/revisions_question.html:8 templates/revisions_question.html:36 -#: templates/backup/revisions_answer.html:6 -#: templates/backup/revisions_answer.html:35 -#: templates/backup/revisions_question.html:6 -#: templates/backup/revisions_question.html:34 -msgid "Revision history" -msgstr "" - -#: templates/tags.html:6 templates/tags.html.py:29 -#: templates/backup/tags.html:5 templates/backup/tags.html.py:28 -msgid "Tag list" -msgstr "" - -#: templates/tags.html:31 templates/backup/tags.html:30 -msgid "sorted alphabetically" -msgstr "" - -#: templates/tags.html:31 templates/backup/tags.html:30 -msgid "by name" -msgstr "" - -#: templates/tags.html:32 templates/backup/tags.html:31 -msgid "sorted by frequency of tag use" -msgstr "" - -#: templates/tags.html:32 templates/backup/tags.html:31 -msgid "by popularity" -msgstr "" - -#: templates/tags.html:38 templates/backup/tags.html:37 -msgid "All tags matching query" -msgstr "" - -#: templates/tags.html:38 templates/backup/tags.html:37 -msgid "all tags - make this empty in english" -msgstr "" - -#: templates/tags.html:41 templates/backup/tags.html:40 -msgid "Nothing found" -msgstr "" - -#: templates/unanswered.html:7 templates/unanswered.html.py:18 -#: templates/backup/unanswered.html:6 templates/backup/unanswered.html:17 -#: templates/tough/unanswered.html:5 templates/tough/unanswered.html.py:16 -msgid "Unanswered questions" -msgstr "" - -#: templates/unanswered.html:97 -#, python-format -msgid "have %(num_q)s unanswered questions" -msgstr "" -"

%(num_q)s
unanswered " -"questions" - -#: templates/unanswered.html:99 templates/backup/questions.html:107 -#: templates/backup/unanswered.html:97 -msgid "Have a total of" -msgstr "" - -#: templates/user_edit.html:6 templates/backup/user_edit.html:4 -msgid "Edit user profile" -msgstr "" - -#: templates/user_edit.html:19 templates/backup/user_edit.html:17 -msgid "edit profile" -msgstr "" - -#: templates/user_edit.html:31 templates/backup/user_edit.html:29 -msgid "image associated with your email address" -msgstr "" - -#: templates/user_edit.html:31 templates/backup/user_edit.html:29 -msgid "avatar" -msgstr "" - -#: templates/user_edit.html:36 templates/user_info.html:31 -#: templates/backup/user_edit.html:34 templates/backup/user_info.html:30 -msgid "Registered user" -msgstr "" - -#: templates/user_edit.html:82 templates/backup/user_edit.html:80 -msgid "Update" -msgstr "" - -#: templates/user_info.html:34 templates/backup/user_info.html:33 -msgid "update profile" -msgstr "" - -#: templates/user_info.html:40 templates/backup/user_info.html:39 -msgid "real name" -msgstr "" - -#: templates/user_info.html:45 -msgid "member for" -msgstr "" - -#: templates/user_info.html:50 templates/backup/user_info.html:49 -msgid "last seen" -msgstr "" - -#: templates/user_info.html:56 templates/backup/user_info.html:55 -msgid "user website" -msgstr "" - -#: templates/user_info.html:62 templates/backup/user_info.html:61 -msgid "location" -msgstr "" - -#: templates/user_info.html:69 templates/backup/user_info.html:68 -msgid "age" -msgstr "" - -#: templates/user_info.html:70 templates/backup/user_info.html:69 -msgid "age unit" -msgstr "" - -#: templates/user_info.html:75 templates/backup/user_info.html:74 -msgid "todays unused votes" -msgstr "" - -#: templates/user_info.html:76 templates/backup/user_info.html:75 -msgid "votes left" -msgstr "" - -#: templates/user_stats.html:15 templates/backup/user_stats.html:14 -msgid "User questions" -msgstr "" - -#: templates/user_stats.html:37 -#, python-format -msgid "the answer has been voted for %(vote_count)s times" -msgstr "" - -#: templates/user_stats.html:37 templates/backup/user_stats.html:36 -msgid "this answer has been selected as correct" -msgstr "" - -#: templates/user_stats.html:43 templates/backup/user_stats.html:42 -#, python-format -msgid "the answer has been commented %(answered_question.comment_count)s times" -msgstr "" - -#: templates/user_stats.html:56 templates/backup/user_stats.html:55 -msgid "votes total" -msgstr "Votes" - -#: templates/user_stats.html:65 templates/backup/user_stats.html:64 -msgid "user has voted up this many times" -msgstr "" - -#: templates/user_stats.html:70 templates/backup/user_stats.html:69 -msgid "user voted down this many times" -msgstr "" - -#: templates/user_stats.html:84 templates/backup/user_stats.html:83 -msgid "Tags" -msgstr "" - -#: templates/user_stats.html:94 templates/backup/user_stats.html:93 -#, python-format -msgid "see other questions tagged '%(tag)s' " -msgstr "" - -#: templates/user_tabs.html:7 templates/backup/user_tabs.html:6 -msgid "User profile" -msgstr "" - -#: templates/user_tabs.html:16 templates/backup/user_tabs.html:15 -msgid "graph of user reputation" -msgstr "" - -#: templates/user_tabs.html:17 templates/backup/user_tabs.html:16 -msgid "reputation history" -msgstr "" - -#: templates/user_tabs.html:24 templates/backup/user_tabs.html:23 -msgid "favorites" -msgstr "" - -#: templates/user_tabs.html:29 templates/backup/user_tabs.html:28 -msgid "settings" -msgstr "" - -#: templates/users.html:6 templates/users.html.py:24 -#: templates/backup/users.html:5 templates/backup/users.html.py:23 -msgid "Users" -msgstr "" - -#: templates/users.html:27 templates/backup/users.html:26 -msgid "recent" -msgstr "" - -#: templates/users.html:28 templates/backup/users.html:27 -msgid "oldest" -msgstr "" - -#: templates/users.html:29 templates/backup/users.html:28 -msgid "by username" -msgstr "" - -#: templates/users.html:35 templates/backup/users.html:34 -#, python-format -msgid "users matching query %(suser)s:" -msgstr "" - -#: templates/users.html:39 templates/backup/users.html:38 -msgid "Nothing found." -msgstr "" - -#: templates/users_questions.html:11 templates/backup/users_questions.html:10 -msgid "this questions was selected as favorite" -msgstr "" - -#: templates/users_questions.html:33 templates/backup/users_questions.html:32 -msgid "this answer has been accepted to be correct" -msgstr "" - -#: templates/authopenid/changeemail.html:6 -msgid "Account: change email" -msgstr "" - -#: templates/authopenid/changeemail.html:9 -msgid "" -"This is where you can change the email address associated with your account. " -"Please keep this email address up to date so we can send you a password-" -"reset email if you request one." -msgstr "" - -#: templates/authopenid/changeemail.html:11 -#: templates/authopenid/changeopenid.html:13 -#: templates/authopenid/changepw.html:18 templates/authopenid/delete.html:14 -#: templates/authopenid/delete.html:24 -msgid "Please correct errors below:" -msgstr "" - -#: templates/authopenid/changeemail.html:28 -msgid "Email" -msgstr "" - -#: templates/authopenid/changeemail.html:29 -#: templates/authopenid/signin.html:59 -msgid "Password" -msgstr "" - -#: templates/authopenid/changeemail.html:31 -msgid "Change email" -msgstr "" - -#: templates/authopenid/changeopenid.html:7 -msgid "Account: change OpenID URL" -msgstr "" - -#: templates/authopenid/changeopenid.html:11 -msgid "" -"This is where you can change your OpenID URL. Make sure you remember it!" -msgstr "" - -#: templates/authopenid/changeopenid.html:28 -msgid "OpenID URL:" -msgstr "" - -#: templates/authopenid/changeopenid.html:29 -msgid "Change OpenID" -msgstr "" - -#: templates/authopenid/changepw.html:13 -msgid "Account: change password" -msgstr "" - -#: templates/authopenid/changepw.html:16 -msgid "This is where you can change your password. Make sure you remember it!" -msgstr "" - -#: templates/authopenid/changepw.html:26 -msgid "Current password" -msgstr "" - -#: templates/authopenid/changepw.html:27 -msgid "New password" -msgstr "" - -#: templates/authopenid/changepw.html:28 -msgid "New password again" -msgstr "" - -#: templates/authopenid/changepw.html:29 templates/authopenid/settings.html:28 -msgid "Change password" -msgstr "" - -#: templates/authopenid/complete.html:4 -msgid "Connect your OpenID with this site" -msgstr "" - -#: templates/authopenid/complete.html:7 -msgid "Connect your OpenID with your account on this site" -msgstr "" - -#: templates/authopenid/complete.html:10 -msgid "Your OpenID is accepted. Please complete this to finish registration." -msgstr "" - -#: templates/authopenid/complete.html:11 -msgid "This account already exists, please use another." -msgstr "" - -#: templates/authopenid/complete.html:16 templates/authopenid/complete.html:29 -#: templates/authopenid/signin.html:42 -msgid "Sorry, looks like we have some errors:" -msgstr "" - -#: templates/authopenid/complete.html:45 -msgid "New account" -msgstr "" - -#: templates/authopenid/complete.html:46 -msgid "User name (will be shown to others, cannot be modified)" -msgstr "" - -#: templates/authopenid/complete.html:47 -msgid "Email (not shared with anyone)" -msgstr "" - -#: templates/authopenid/complete.html:48 -msgid "create account" -msgstr "" - -#: templates/authopenid/complete.html:56 -msgid "Existing account" -msgstr "" - -#: templates/authopenid/complete.html:57 -msgid "user name" -msgstr "" - -#: templates/authopenid/complete.html:58 -msgid "password" -msgstr "" - -#: templates/authopenid/complete.html:61 -msgid "Register" -msgstr "" - -#: templates/authopenid/complete.html:62 templates/authopenid/signin.html:61 -msgid "Forgot your password?" -msgstr "" - -#: templates/authopenid/delete.html:8 -msgid "Account: delete account" -msgstr "" - -#: templates/authopenid/delete.html:12 -msgid "" -"Note: After deleting your account, anyone will be able to register this " -"username." -msgstr "" - -#: templates/authopenid/delete.html:16 -msgid "Check confirm box, if you want delete your account." -msgstr "" - -#: templates/authopenid/delete.html:19 -msgid "Password:" -msgstr "" - -#: templates/authopenid/delete.html:31 -msgid "I am sure I want to delete my account." -msgstr "" - -#: templates/authopenid/delete.html:32 -msgid "Password/OpenID URL" -msgstr "" - -#: templates/authopenid/delete.html:32 -msgid "(required for your security)" -msgstr "" - -#: templates/authopenid/delete.html:34 -msgid "Delete account permanently" -msgstr "" - -#: templates/authopenid/sendpw.html:3 templates/authopenid/sendpw.html.py:7 -msgid "Send new password" -msgstr "" - -#: templates/authopenid/sendpw.html:11 -msgid "Lost your password? No problem - here you can reset it." -msgstr "" - -#: templates/authopenid/sendpw.html:12 -msgid "" -"Please enter your username below and new password will be sent to your " -"registered e-mail" -msgstr "" - -#: templates/authopenid/sendpw.html:29 -msgid "Reset password" -msgstr "" - -#: templates/authopenid/sendpw.html:29 -msgid "return to login" -msgstr "" - -#: templates/authopenid/sendpw.html:32 -msgid "" -"Note: your new password will be activated only after you click the " -"activation link in the email message" -msgstr "" - -#: templates/authopenid/settings.html:29 -msgid "Give your account a new password." -msgstr "" - -#: templates/authopenid/settings.html:30 -msgid "Change email " -msgstr "" - -#: templates/authopenid/settings.html:31 -msgid "Add or update the email address associated with your account." -msgstr "" - -#: templates/authopenid/settings.html:34 -msgid "Change openid associated to your account" -msgstr "" - -#: templates/authopenid/settings.html:37 -msgid "Delete account" -msgstr "" - -#: templates/authopenid/settings.html:38 -msgid "Erase your username and all your data from website" -msgstr "" - -#: templates/authopenid/signin.html:3 templates/authopenid/signin.html:16 -msgid "User login" -msgstr "" - -#: templates/authopenid/signin.html:21 -msgid "we support two login modes" -msgstr "" -"You can log in either through one of these services or traditionally - using " -"local username/password." - -#: templates/authopenid/signin.html:26 templates/authopenid/signup.html:49 -msgid "Login with your OpenID" -msgstr "" - -#: templates/authopenid/signin.html:28 -msgid "select openid provider" -msgstr "1) Please select your id service provider." - -#: templates/authopenid/signin.html:32 -msgid "verify openid link and login" -msgstr "" -"2) Please verify the OpenID URL (type your login name over {username}, if present)" -" and then log in." - -#: templates/authopenid/signin.html:57 -msgid "Use login name and password" -msgstr "" - -#: templates/authopenid/signin.html:58 -msgid "Login name" -msgstr "" - -#: templates/authopenid/signin.html:62 -msgid "Create new acccount" -msgstr "" - -#: templates/authopenid/signin.html:71 -msgid "Why use OpenID?" -msgstr "" - -#: templates/authopenid/signin.html:75 -msgid "with openid it is easier" -msgstr "With the OpenID you don't need to create new username and password." - -#: templates/authopenid/signin.html:78 -msgid "reuse openid" -msgstr "You can safely re-use the same login for all OpenID-enabled websites." - -#: templates/authopenid/signin.html:81 -msgid "openid is widely adopted" -msgstr "" -"There are > 160,000,000 OpenID account in use. Over 10,000 sites are OpenID-" -"enabled." - -#: templates/authopenid/signin.html:84 -msgid "openid is supported open standard" -msgstr "OpenID is based on an open standard, supported by many organizations." - -#: templates/authopenid/signin.html:88 -msgid "Find out more" -msgstr "" - -#: templates/authopenid/signin.html:89 -msgid "Get OpenID" -msgstr "" - -#: templates/authopenid/signup.html:2 templates/authopenid/signup.html.py:6 -msgid "Signup" -msgstr "" - -#: templates/authopenid/signup.html:10 -msgid "" -"We support two types of user registration: conventional username/password, " -"and" -msgstr "" - -#: templates/authopenid/signup.html:10 -msgid "the OpenID method" -msgstr "" - -#: templates/authopenid/signup.html:15 -msgid "Sorry, looks like we have some errors" -msgstr "" - -#: templates/authopenid/signup.html:33 -msgid "Conventional registration" -msgstr "" - -#: templates/authopenid/signup.html:34 -msgid "choose a user name" -msgstr "" - -#: templates/authopenid/signup.html:40 -msgid "back to login" -msgstr "" - -#: templates/authopenid/signup.html:46 -msgid "Register with your OpenID" -msgstr "" - -# -#: templates/backup/answer_edit_tips.html:3 -#: templates/backup/question_edit_tips.html:2 -msgid "editing tips" -msgstr "Tips" - -#: templates/backup/questions.html:108 -msgid "number of questions" -msgstr "" - -#: templates/backup/questions.html:110 -msgid "tagged with" -msgstr "" - -#: templates/backup/questions.html:116 -msgid "whose title contains" -msgstr "" - -#: templates/backup/questions.html:121 -msgid "number of questions end of sentence." -msgstr "" - -#: templates/backup/questions.html:123 -msgid "Questions are sorted by entry date." -msgstr "" - -#: templates/backup/questions.html:123 -msgid "Newest questions shown first." -msgstr "" -"Questions are sorted by entry date.Newest questions shown " -"first." - -#: templates/backup/unanswered.html:98 templates/tough/unanswered.html:95 -msgid "number of unanswered questions" -msgstr "" - -#: templates/backup/user_info.html:44 -msgid "member since" -msgstr "" - -#: templates/backup/user_stats.html:36 -#, python-format -msgid "the answer has been voted for %(answered_question.vote_count)s times" -msgstr "" - -#: templates/tough/question_retag.html:2 -msgid "Revise tags" -msgstr "" - -#: templates/tough/question_retag.html:37 -msgid "tags are requried" -msgstr "" - -#: templates/tough/question_retag.html:38 -msgid "up to 5 tags, less than 20 characters each" -msgstr "" - -#: templates/tough/question_retag.html:51 -msgid "Change tags" -msgstr "" - -#: templates/tough/question_retag.html:74 -msgid "Change now" -msgstr "" - -#: templates/tough/question_retag.html:85 -msgid "Why use and modify tags?" -msgstr "" - -#: templates/tough/question_retag.html:96 -msgid "tag editors receive special awards from the community" -msgstr "" diff --git a/locale/zh-cn/LC_MESSAGES/django.mo b/locale/zh-cn/LC_MESSAGES/django.mo deleted file mode 100644 index 8b8f5bb9..00000000 Binary files a/locale/zh-cn/LC_MESSAGES/django.mo and /dev/null differ diff --git a/locale/zh-cn/LC_MESSAGES/django.po b/locale/zh-cn/LC_MESSAGES/django.po deleted file mode 100644 index 5cad5b51..00000000 --- a/locale/zh-cn/LC_MESSAGES/django.po +++ /dev/null @@ -1,1430 +0,0 @@ -#author Evgeny Fadeev (evgeny.fadeev@gmail.com) -#site-specific messages -msgid "site title" -msgstr "CNProg.com" - -msgid "site slogan" -msgstr "绋嬪簭鍛橀棶绛旂ぞ鍖" - -msgid "meta site keywords, comma separated" -msgstr "鎶鏈棶绛旂ぞ鍖猴紝涓浗绋嬪簭鍛橈紝缂栫▼鎶鏈ぞ鍖猴紝绋嬪簭鍛樼ぞ鍖猴紝绋嬪簭鍛樿鍧涳紝绋嬪簭鍛榳iki锛岀▼搴忓憳鍗氬" - -msgid "meta site content" -msgstr "涓浗绋嬪簭鍛樼殑缂栫▼鎶鏈棶绛旂ぞ鍖恒傛垜浠仛涓撲笟鐨勩佸彲鍗忎綔缂栬緫鐨勬妧鏈棶绛旂ぞ鍖恒" - -msgid "copyright message" -msgstr "Copyright(c)2009.CNPROG.COM" - -msgid "Connect your OpenID with this site" -msgstr "缁戝畾OpenID" - -msgid "Connect your OpenID with your account on this site" -msgstr "缁戝畾OpenID甯愬彿" - -msgid "Your OpenID is accepted. Please complete this to finish the registration. " -msgstr "鎮ㄧ殑OpenID甯愬彿宸茬粡楠岃瘉閫氳繃! 璇峰畬鎴愭渶鍚庝竴姝 - 缁戝畾OpenID鍒版偍鐨勫笎鍙枫" - -#minimal length of user name may be language specific -msgid "username too short" -msgstr "鐢ㄦ埛鍚嶅お鐭紝璇蜂娇鐢ㄤ笁涓垨涓変釜浠ヤ笂瀛楃" - -#translation and user name validation are language-specific -msgid "invalid user name" -msgstr "鐢ㄦ埛鍚嶅彧鑳藉寘鍚嫳鏂囧瓧姣嶃佹暟瀛楀拰涓嬪垝绾" - -#chinese translation is domain specific -msgid "question if off-topic or not relevant" -msgstr "涓嶆槸缂栫▼鎶鏈棶棰" - -msgid "Login name" -msgstr "鐢ㄦ埛鍚" - -msgid "welcome to website!" -msgstr "CNProg娆㈣繋鎮!" - -msgid "what is this website" -msgstr "CNProg鏄竴涓闈㈠悜绋嬪簭鍛鐨勫彲鍗忎綔缂栬緫鐨寮鏀炬簮浠g爜闂瓟绀惧尯銆" - -msgid "what can one do on this website" -msgstr "鎮ㄥ彲浠ュ湪杩欓噷鎻愰棶鍚勭被绋嬪簭鎶鏈棶棰 - 闂涓嶅垎璇█鍜屽钩鍙般 鍚屾椂涔熷笇鏈涙偍瀵瑰姏鎵鑳藉強鐨勯棶棰橈紝缁欎簣鎮ㄧ殑瀹濊吹绛旀銆" - -msgid "Goal of this site is..." -msgstr "CNProg 鏄负浜嗗府鍔╃▼搴忓憳瑙e喅鏇村闂锛屾洿鍔犳柟渚跨殑瑙e喅闂銆" - -msgid "how privacy policy can be changed" -msgstr "鎴戜滑鍙兘鍦ㄤ簨鍏堥氱煡鎴栦笉閫氱煡鐨勬儏鍐典笅闅忔椂鏇存敼姝'闅愮鏀跨瓥'锛屾垜浠缓璁敤鎴锋椂甯告煡鐪婥NProg闅愮鏀跨瓥鐨勬敼鍔紝鍦ㄤ换浣曟敼鍔ㄧ敓鏁堝悗鎮ㄧ殑缁х画璁块棶鍜屼娇鐢ㄦ湰绔欙紝鎴戜滑鍋囪鎮ㄥ凡鍚屾剰浜咰NProg浠ヤ笂鐨勬墍鏈夋潯娆俱" - -msgid "general message about privacy" -msgstr "CNProg鎵胯鐢ㄦ埛闅愮鐨勯噸瑕佹с傛湰鏂囦欢姒傝堪鍦ㄦ偍娴忚CNProg杩囩▼涓墍鎺ユ敹鍜屾敹闆嗙殑涓汉淇℃伅鐨勭绫伙紝浠ュ強CNProg鎵閲囧彇鐨勪繚鎶や俊鎭殑涓浜涙帾鏂姐侰NProg甯屾湜杩欏皢鏈夊姪浜庢偍鍦ㄧ煡鎯呯殑鎯呭喌涓嬶紝灏卞拰鎴戜滑 鍏变韩涓汉淇℃伅鐨勯棶棰樹綔鍑哄喅瀹氥" - -msgid "cookie policy details" - -msgstr "璁块棶CNProg鏃讹紝鎴戜滑浼氬悜鎮ㄧ殑璁$畻鏈哄彂閫佷竴涓垨澶氫釜涓撻棬鐢ㄤ簬璇嗗埆鎮ㄧ殑娴忚鍣ㄧ殑Cookie锛堝寘鍚竴涓瓧绗︿覆鐨勫皬鏂囦欢锛夈 " -"浣跨敤 Cookie 鐨勭洰鐨勬槸閫氳繃鍌ㄥ瓨鐢ㄦ埛鍋忓ソ銆佽窡韪敤鎴峰惧悜锛堜緥濡傛悳绱" -"鏂规硶锛夋潵鎻愰珮鎴戜滑鐨勬湇鍔¤川閲忋傚ぇ澶氭暟娴忚鍣ㄧ殑鍒濆璁剧疆鍧囦负鎺ュ彈 Cookie锛屼絾涔熷彲浠ュ皢鍏堕噸缃负鎷掔粷鎵鏈 Cookie 鎴栧湪鏀跺埌 Cookie 鏃舵彁绀恒備笉杩囷紝濡傛灉绂佺敤 Cookie锛屾煇浜涘姛鑳藉拰鏈嶅姟鍙兘鏃犳硶姝e父杩愯銆" - -msgid "details on sharing data with third parties" -msgstr "CNProg鍙兘浼氭敹闆嗗拰缁熻鐢ㄦ埛璁块棶鏈珯鐨勬鍐垫暟鎹備緥濡傦紝CNProg鍙兘浼氭娴嬬綉绔欐渶娴佽鐨勯儴鍒嗗姛鑳姐侰NProg鍙兘浼氬叕寮鏄剧ず鎴栬呮彁渚涚粰绗笁鏂逛娇鐢ㄨ鏁版嵁銆備絾鏄紝CNProg涓嶄細鍏紑鎮ㄧ殑韬唤淇℃伅銆" - -msgid "details on personal information policies" -msgstr "鍦ㄧ櫥褰曚娇鐢–NProg鐨勬彁闂拰鍥炵瓟鍔熻兘鏃讹紝鎴戜滑瑕佹眰浣跨敤鑰呮彁渚涚敤鎴峰悕銆佸瘑鐮併佺數瀛愰偖浠剁瓑淇℃伅銆侰NProg鏀堕泦杩欑被鍏充簬涓汉韬唤鐨勪俊鎭彧鏄负浜嗙櫥褰曠郴缁熻幏寰椾娇鐢ㄥ姛鑳界殑鐩殑銆傛垜浠笉浼氬悜浠讳綍鍏朵粬绀惧尯鐢 鎴枫佷釜浜烘垨绗笁鏂归忛湶鎮ㄧ殑瀵嗙爜鎴栬呯數瀛愰偖浠朵俊鎭傜敤鎴峰彲浠ラ夋嫨鎬у湴濉啓鐢ㄦ埛璧勬枡銆佷釜浜虹綉绔欍佸勾榫勩佸煄甯傜瓑淇℃伅锛屾垜浠敹闆嗚繖浜涘唴瀹逛负浜嗕娇鐢ㄦ埛鑳藉鏇村鏄撳拰鏇存弧鎰忓湴浣跨敤CNProg鎻愪緵鐨勭綉椤靛拰鏈嶅姟銆" - -msgid "Community gives you awards for your questions, answers and votes." -msgstr "鎻愬嚭闂锛岀粰浜堝洖绛旓紝鎶曞嚭浣犵殑绁 - CNProg 浼氶拡瀵逛綘鍦ㄧぞ鍖虹殑琛ㄧ幇锛屾巿浜堜綘鍚勭被濂栫墝銆" - -msgid "what technical information is collected about visitors" -msgstr "褰撴偍璁块棶鏈綉绔欐垨浣跨敤鎴戜滑鐨勬煇浜涘湪绾挎湇鍔℃椂锛屾湇鍔″櫒浼氳嚜鍔ㄨ褰曚俊鎭紝鍖呮嫭浣嗕笉闄愪簬URL銆両P鍦板潃銆佹祻瑙堝櫒鐨勭被鍨嬨佸睆骞曞垎杈ㄧ巼銆佺郴缁熺被鍨嬪拰浣跨敤鐨勮瑷浠ュ強璁块棶鏃ユ湡鍜屾椂闂淬傛垜浠殑鐩殑鏄负浜嗗悜鎮>鎻愪緵鏇村ソ鐨勭敤鎴锋湇鍔★紝鍖呮嫭鍙兘涓烘偍鎻愪緵瀹氬埗鐨勫湪绾挎湇鍔°" - -msgid "please make your answer relevant to this community" -msgstr "鎮ㄧ殑闂涓庣紪绋嬬浉鍏冲悧锛" - - -#templates/book.html 78 -msgid "reading channel" -msgstr "璇讳功棰戦亾" - -msgid "[author]" -msgstr "銆愪綔鑰呫" - -msgid "[publisher]" -msgstr "銆愬嚭鐗堢ぞ銆" - -msgid "[publication date]" -msgstr "銆愬嚭鐗堟棩鏈熴" - -msgid "[price]" -msgstr "銆愪环鏍笺" - -msgid "[pages]" -msgstr "銆愰〉鏁般" - -msgid "[tags]" -msgstr "銆愭爣绛俱" - -msgid "author blog" -msgstr "浣滆呭崥瀹" - -msgid "book directory" -msgstr "涔︾睄鐩綍" - -msgid "buy online" -msgstr "缃戜笂璐拱" - -msgid "book technical Q&A" -msgstr "鍥句功鐩稿叧鐨勬妧鏈瓟鐤" - -msgid "reader questions" -msgstr "绛旇鑰呴棶" - -msgid "ask the author" -msgstr "鍚戜綔鑰呮彁闂" - -msgid "this question was selected as favorite" -msgstr "杩欎釜闂琚" - -msgid "number of times" -msgstr "浣嶇敤鎴锋敹钘" - -msgid "votes" -msgstr "绁" - -msgid "the answer has been accepted to be correct" -msgstr "鏈夌瓟妗堝凡琚帴鍙椾负姝g‘绛旀" - -msgid "views" -msgstr "娴忚" - -#must have extra space after in english -msgid "see questions tagged" -msgstr "鏌ョ湅鏈夊叧" - -#book.html line 123 must be empty in english -msgid "using tags" -msgstr "鐨勯棶棰" - -#this is how above two are supposed to be -msgid "see questions tagged '%s'" -msgstr "鏌ョ湅鏈夊叧'%s'鐨勯棶棰" - -msgid "subscribe to book RSS feed" -msgstr "RSS璁㈤槄璇ュ浘涔︽渶鏂伴棶棰" - -msgid "subscribe to the questions feed" -msgstr "璁㈤槄鏈>鏂伴棶棰" - -#base_content.html -msgid "congratulations, community gave you a badge" -msgstr "鎭枩鎮紝绀惧尯缁欐偍棰佸彂浜嗗鐗" - -msgid "see" -msgstr "鏌ョ湅" - -msgid "profile" -msgstr "涓汉璧勬枡" - -#close.html -msgid "Close question" -msgstr "鍏抽棴闂" - -msgid "Close the question" -msgstr "鐢变簬浠ヤ笅鍘熷洜锛屼綘瑕佸叧闂繖涓棶棰" - -msgid "Reasons" -msgstr "鍘熷洜" - -msgid "OK to close" -msgstr "纭畾鍏抽棴" - -msgid "Cancel" -msgstr "鍙栨秷" - -#footer.html -msgid "about" -msgstr "鍏充簬鏈珯" - -msgid "faq" -msgstr "甯歌闂" - -msgid "blog" -msgstr "Blog" - -msgid "contact us" -msgstr "鑱旂郴鎴戜滑" - -msgid "privacy policy" -msgstr "闅愮鏀跨瓥" - -msgid "give feedback" -msgstr "闂鍙嶉" - -msgid "current revision" -msgstr "褰撳墠鐗堟湰" - -#index.html -msgid "community wiki" -msgstr "绀惧尯Wiki" - -msgid "Home" -msgstr "棣栭〉" - -msgid "Questions" -msgstr "闂鍒楄〃" - -msgid "User questions" -msgstr "涓棶棰" - -msgid "newest" -msgstr "鏈鏂伴棶棰" - -msgid "latest questions" -msgstr "鏈鏂伴棶棰" - -msgid " - " -msgstr "-" - -msgid "last updated questions" -msgstr "鏈鏂版洿鏂扮殑闂" - -msgid "hottest" -msgstr "鐑棬闂" - -msgid "hottest questions" -msgstr "琚洖澶嶆渶澶氱殑闂" - -msgid "most voted" -msgstr "鏈鏈変环鍊肩殑闂" - -msgid "most voted questions" -msgstr "鎶曠エ娆℃暟鏈澶氱殑闂" - -msgid "all questions" -msgstr "鍏ㄩ儴闂" - -msgid "answers" -msgstr "鍥炵瓟" - -msgid "Answers" -msgstr "涓洖绛" - -msgid "number of votes" -msgstr "绁ㄦ暟" - -msgid "Recent tags" -msgstr "鏈鏂版爣绛" - -msgid "popular tags" -msgstr "鍙楁杩庣殑鏍囩" - -msgid "Recent awards" -msgstr "鏈鏂板鐗" - -msgid "given to" -msgstr "鎺堜簣" - -msgid "all awards" -msgstr "鎵鏈夊鐗" - -msgid "subscribe to last 30 questions by RSS" -msgstr "RSS璁㈤槄鏈鏂30涓棶棰" - -msgid "Still looking for more? See" -msgstr "鍦ㄥ鎵炬洿澶氶棶棰樺悧锛熻鏌ラ槄" - -msgid "complete list of questions" -msgstr "鍏ㄩ儴闂鍒楄〃" - -msgid "or" -msgstr "鎴栬" - -msgid "." -msgstr "銆" - -msgid "Please help us answer" -msgstr "璇峰府鍔╂垜浠洖绛" - -msgid "unanswered questions" -msgstr "娌℃湁鍥炵瓟鐨勯棶棰" - -msgid "Unanswered questions" -msgstr "娌℃湁鍥炵瓟鐨勯棶棰" - -#revisions_answer.html -msgid "Revision history" -msgstr "鐗堟湰鍘嗗彶" - -msgid "back" -msgstr "杩斿洖" - -msgid "revision" -msgstr "鐗堟湰" - -msgid "edit" -msgstr "缂栬緫" - -msgid "asked" -msgstr "鎻愰棶浜" - -msgid "updated" -msgstr "鏇存柊浜" - -msgid "Tag list" -msgstr "鏍囩鍒楄〃" - -msgid "by name" -msgstr "鎸夊悕绉版帓搴" - -msgid "sorted alphabetically" -msgstr "鎸夊悕绉扮殑瀛楁瘝鍏堝悗椤哄簭鎺掑簭" - -msgid "by polularity" -msgstr "鎸夋祦琛岀▼搴︽帓搴" - -msgid "sorted by frequency of tag use" -msgstr "鎸夋爣绛捐浣跨敤鐨勬鏁版帓搴" - -msgid "All tags matching query" -msgstr "鍖归厤鏌ヨ" - -msgid "all tags - make this empty in english" -msgstr "鐨勬墍鏈夋爣绛" - -msgid "Nothing found." -msgstr "娌℃湁鎵惧埌鐩稿叧鏁版嵁銆" - -#paginator.html -msgid "previous" -msgstr "涓婁竴椤" - -msgid "current page" -msgstr "褰撳墠椤" - -msgid "next page" -msgstr "涓嬩竴椤" - -msgid "page number " -msgstr "绗" - -msgid "number - make blank in english" -msgstr "椤" - -msgid "Change tags" -msgstr "淇敼闂鏍囩" - -msgid "tags are required" -msgstr "鏍囩涓嶈兘涓虹┖銆" - -msgid "please use 5 tags or less" -msgstr "鏈澶氬彧鑳芥湁5涓爣绛" - -#todo: remove magic numbers from this file -msgid "up to 5 tags, less than 20 characters each" -msgstr "鏈澶5涓爣绛撅紝姣忎釜鏍囩闀垮害灏忎簬20涓瓧绗︺" - -msgid "Change now" -msgstr "鐜板湪淇敼" - -#synonym of above in Edit question -msgid "Save edit" -msgstr "鐜板湪淇敼" - -msgid "uses tags for the classification of questions" -msgstr "鐢ㄦ爣绛炬潵鍒嗙被绯荤粺鐨勪俊鎭" - -msgid "tag editors receive special awards from the community" -msgstr "淇敼鏍囩鐨勭敤鎴峰皢鎺堜簣鐗规畩鐨勭ぞ鍖哄鐗" - -msgid "Why use and modify tags?" -msgstr "涓轰粈涔堟垜鍙兘淇敼闂鏍囩锛" - -msgid "Found by tag" -msgstr "鏍囩闂" - -msgid "Found by title" -msgstr "鏌ヨ缁撴灉" - -msgid "All questions" -msgstr "鎵鏈夐棶棰" - -msgid "active" -msgstr "娲昏穬闂" - -msgid "most recently asked questions" -msgstr "鏈鏂板姞鍏ョ郴缁熺殑闂" - -msgid "most recently updated questions" -msgstr "鏈杩戣鏇存柊鐨勯棶棰" - -msgid "latest questions info" -msgstr "" -"闂鎸鎻愰棶鏃堕棿鏄剧ず鎺掑簭銆" -"鏂板姞鍏ョ殑闂灏嗘樉绀哄湪鏈鍓嶉潰銆" - -#: templates/questions.html:109 -#, python-format -msgid "" -"\n" -"\t\t\thave total %(q_num)s questions tagged %(tagname)s\n" -"\t\t\t" -msgid_plural "" -"\n" -"\t\t\thave total %(q_num)s questions tagged %(tagname)s\n" -"\t\t\t" -msgstr[0] "" -"\n" -"鎮ㄦ鍦ㄦ祻瑙堟墍鏈" -"
%(q_num)s
" -"涓爣璁颁负%(tagname)s

" -msgstr[1] "" -"\n" -"鎮ㄦ鍦ㄦ祻瑙堟墍鏈" -"
%(q_num)s
" -"涓爣璁颁负%(tagname)s

" - -#: templates/questions.html:109 -#, python-format -msgid "" -"\n" -"\t\t\thave total %(q_num)s questions containing %(searchtitle)s\n" -"\t\t\t" -msgid_plural "" -"\n" -"\t\t\thave total %(q_num)s questions containing %(searchtitle)s\n" -"\t\t\t" -msgstr[0] "" -"\n" -"鎮ㄦ鍦ㄦ祻瑙堟墍鏈" -"
%(q_num)s
" -"涓爣棰樺惈鏈%(searchtitle)s

" -msgstr[1] "" -"\n" -"鎮ㄦ鍦ㄦ祻瑙堟墍鏈" -"
%(q_num)s
" -"涓爣棰樺惈鏈%(searchtitle)s

" - -#in unanswered.html and somewhere else -msgid "Have a total of" -msgstr "鎮ㄦ鍦ㄦ祻瑙堟墍鏈" - -msgid "number of questions" -msgstr "涓" - -msgid "number of unanswered questions" -msgstr "涓 娌℃湁鍥炵瓟鐨 闂銆" - -msgid "tagged with" -msgstr "鏍囪涓" - -msgid "whose title contains" -msgstr "鏍囬鍚湁" - -msgid "number of questions end of sentence" -msgstr "鐨勯棶棰樸" - -msgid "Questions are sorted by the time of last update." -msgstr "闂鎸鏈鍚庢洿鏂版椂闂鏄剧ず鎺掑簭銆" - -msgid "Most recently answered ones are shown first." -msgstr "鏈鍚庤鍥炵瓟鎴栬>鏇存柊鐨勯棶棰樺皢鏄剧ず鍦ㄦ渶鍓嶉潰銆" - -msgid "Questions sorted by number of responses." -msgstr "闂鎸鍥炲鏁伴噺鏄剧ず鎺掑簭銆" - -msgid "Most answered questions are shown first" -msgstr "鍥炲鏈澶氱殑闂灏嗘樉绀哄湪鏈鍓嶉潰銆" - -msgid "Questions are sorted by the number of votes." -msgstr "闂鎸鎶曠エ鏁伴噺鏄剧ず鎺掑簭銆" - -msgid "Most voted questions are shown first" -msgstr "鎶曠エ鏈澶氱殑闂灏嗘樉绀哄湪鏈鍓嶉潰銆" - -msgid "Related tags" -msgstr "鐩稿叧鏍囩" - -msgid "Reopen question" -msgstr "閲嶈闂" - -msgid "Open the previously closed question" -msgstr "浣犲皢鎵撳紑杩欎釜宸茬粡琚叧闂殑闂" - -msgid "The question was closed for the following reason" -msgstr "闂鏇句互" - -msgid "reason - leave blank in english" -msgstr "鐨勫師鍥犺" - -msgid "on" -msgstr "浜" - -msgid "date closed" -msgstr "鍏抽棴" - -msgid "reopen this question" -msgstr "纭畾鎵撳紑杩欎釜闂" - -msgid "Edit user profile" -msgstr "淇敼涓汉璧勬枡" - -msgid "edit profile" -msgstr "淇敼璧勬枡" - -msgid "image associated with your email address" -msgstr "鍜屾偍鐨勯偖浠跺湴鍧鏄粦瀹氱殑" - -msgid "avatar" -msgstr "淇敼澶村儚" - -msgid "Registered user" -msgstr "娉ㄥ唽鐢ㄦ埛" - -msgid "Update" -msgstr "鏇存柊" - -msgid "User profile" -msgstr "鐢ㄦ埛姒傝" - -msgid "overview" -msgstr "姒傝" - -msgid "recent activity" -msgstr "鏈杩戞椿鍔" - -msgid "comments and answers to others questions" -msgstr "鍏朵粬鐢ㄦ埛鐨勫洖澶嶅拰璇勮" - -msgid "responses" -msgstr "鍥炲簲" - -msgid "reputation history" -msgstr "绉垎" - -msgid "reputation" -msgstr "绉垎" - -msgid "graph of user reputation" -msgstr "鐢ㄦ埛鐨勭ぞ鍖虹Н鍒嗗巻鍙" - -msgid "user vote record" -msgstr "鐢ㄦ埛鎵鏈夋姇绁" - -msgid "casted votes" -msgstr "鎶曠エ" - -msgid "questions that user selected as his/her favorite" -msgstr "鐢ㄦ埛鏀惰棌鐨勯棶棰" - -msgid "users favorite questions" -msgstr "鐢ㄦ埛鏀惰棌鐨勯棶棰" - -msgid "favorites" -msgstr "鏀惰棌" - -msgid "favorite-questions" -msgstr "鏀惰棌" - -msgid "user preference settings" -msgstr "鐢ㄦ埛鍙傛暟鐨勮缃" - -msgid "settings" -msgstr "璁剧疆" - -msgid "preferences" -msgstr "璁剧疆" - -msgid "About" -msgstr "鍏充簬鏈珯" - -msgid "logout" -msgstr "閫鍑虹櫥褰" - -msgid "Logout" -msgstr "閫鍑虹櫥褰" - -msgid "As a registered user you can login with your OpenID, log out of the site or permanently remove your account." -msgstr "鎮ㄦ槸绯荤粺鐨娉ㄥ唽鐢ㄦ埛锛屽彲浠ラ殢鏃朵娇鐢∣penID甯愬彿鐧诲綍绯荤粺鎴栬呮敞閿鐧诲綍銆" - -msgid "Logout now" -msgstr "鐐瑰嚮閫鍑虹櫥褰" - -msgid "Frequently Asked Questions " -msgstr "甯歌闂" - -msgid "What kinds of questions can I ask here?" -msgstr "鎴戝彲浠ュ湪杩欓噷鎻愰棶浠涔堟牱鐨勯棶棰橈紵" - -msgid "What questions should I avoid asking?" -msgstr "浠涔堟牱鐨勯棶棰樻垜涓嶈鍦ㄨ繖閲屾彁闂紵" - -msgid "Most importanly - questions should be relevant to this community." -msgstr "姣棤鐤戦棶锛岄鍏堝繀椤绘槸鎶鏈紪绋嬮棶棰橈紒" - -msgid "Before asking the question - please make sure to use search to see whether your question has alredy been answered." -msgstr "鎻愰棶涔嬪墠锛屽厖鍒嗗埄鐢ㄧ郴缁熺殑鑷姩鏌ユ壘銆佹爣绛惧拰鎼滅储锛岀湅鐪嬫槸鍚﹀凡缁忔湁涓鏍风殑闂骞舵湁浜嗙瓟妗堛" - -msgid "What should I avoid in my answers?" -msgstr "浠涔堟牱鐨勫洖绛旀槸涓嶅彈娆㈣繋鐨勶紵" - -msgid "Who moderates this community?" -msgstr "璋佹槸绀惧尯鐨勭鐞嗗憳锛" - -msgid "Please avoid asking questions that are not relevant to this community, too subjective and argumentative." -msgstr "涓庣▼搴忓憳鎴栨妧鏈棤鍏崇殑锛屽紩璧蜂簤鍚垫垨澶繃浜庝富瑙傛х瓑杩濊儗绀惧尯瀹楁棬鐨勫唴瀹广鏈珯寤虹珛鏄负浜嗗府鍔╁ぇ浼楃▼搴忓憳瑙e喅瀹為檯鎶鏈棶棰橈紝鎴戜滑闇瑕佸疄闄呯殑闂锛" - -msgid "is a Q&A site, not a discussion group. Therefore - please avoid having discussions in your answers, comment facility allows some space for brief discussions." -msgstr "甯屾湜鐢ㄦ埛鎻愪緵閽堝鎻愰棶鐨勬妧鏈洖绛旓紝鍙互鏄繘涓姝ヤ簡瑙i棶棰樺疄璐紝缁欎簣鍙傝冩柟妗堬紝鎴栧畬鍏ㄨВ鍐抽棶棰樼殑鍥炵瓟銆傛垜浠笇鏈涢氳繃闂瓟鐨勫舰寮忚В鍐崇敤鎴风殑瀹為檯闂銆傚洜姝わ紝鎴戜滑涓>娆㈣繋鍦ㄥ洖绛斾腑鍑虹幇涓嶆槸鍥炵瓟闂鐨勫唴瀹癸紝鍖呮嫭閽堝浠栦汉鍥炵瓟鐨勮璁猴紝鍜屽叾浠栨棤鎰忎箟鐨勬氮璐圭綉缁滆祫婧愯涓銆侰NProg寤鸿鎮ㄤ娇鐢璇勮鍔熻兘鏉ヨ璁轰綘鐨勬剰瑙佸拰鎯虫硶銆" - -msgid "The short answer is: you." -msgstr "绛旀鏄細姣忎釜鐢ㄦ埛銆" - -msgid "The reputation system allows users earn the authorization to perform a variety of moderation tasks." -msgstr "閫氳繃绉垎杩愪綔锛姣忎釜鐢ㄦ埛閮芥湁鏉冮檺鍒涘缓鏍囩锛岃繘琛屽鎵鏈夐棶棰樸佸洖绛旂殑鎶曠エ銆佺紪杈戙佸叧闂瓑鎿嶄綔銆" - -msgid "This website is moderated by the users." -msgstr "绀惧尯娌℃湁涓ユ牸鎰忎箟涓婄殑绠$悊鍛樿韩浠" - -msgid "How does reputation system work?" -msgstr "浠涔堟槸绀惧尯绉垎锛" - -msgid "Anyone can ask questions and give answers, points are not necessary for that." -msgstr "瀵逛簬姝e父浣跨敤绀惧尯杩涜鎻愰棶銆佸洖绛旇岃█锛岀Н鍒嗕笉鏄繀椤荤殑銆" - -msgid "As we've said before, users help running this site. Point system helps select users who can administer this community." -msgstr "鎴戜滑涓鍐嶅0鏄庯紝CNProg鐢变綘鏉ヨ繍琛屽拰缁存姢銆傚鏋滀綘鎯冲府鍔╂垜浠潵杩愪綔CNProg锛屼綘闇瑕佷竴瀹氱殑绉垎绛夌骇銆" - -msgid "Reputation points roughly measure how community trusts you. These points are given to you directly by other members of the community." -msgstr "绉垎鏄竴绉嶇敤鏉ョ矖鐣ヨ 閲忕ぞ鍖哄浣犳湁澶氫俊浠荤殑鏁版嵁銆绉垎涓嶆槸鏈夎皝鏉ユ敮浠樻垨鐩存帴缁欎簣浣犵殑锛岃屾槸浣犻氳繃鑾峰緱鍏朵粬鐢ㄦ埛鐨勬敮鎸佸拰淇′换鈥滆禋寰椻濈殑銆" - -msgid "For example, if you ask an interesting question or give a helpful answer, your input will be upvoted and you will gain more trust in the community." -msgstr "涓句緥鏉ヨ锛屽鏋滀綘鎻愪簡涓涓潪甯告湁甯姪鐨勯棶棰樻垨鑰呭仛浜嗗緢鏈夌敤鐨勫洖绛旓紝浣犲皢浼氳鍏朵粬鐢ㄦ埛鎶曡禐鎴愮エ銆" - -msgid "If on the other hand someone gives a misleading answer, the answer will be voted down and he/she loses some points." -msgstr "鐩稿弽锛屼綘鎻愪簡涓嶅彈娆㈣繋鐨勯棶棰橈紝鎴栬呰瀵肩敤鎴风殑鍥炵瓟锛屼綘灏嗗彲鑳借鍏朵粬鐢ㄦ埛鎶曞弽瀵圭エ銆傛瘡涓禐鎴" - -msgid "Each vote in favor will generate 10 points, each vote against will subtract 2 points." -msgstr "绁ㄤ細甯綘浜х敓10涓ぞ鍖虹Н鍒嗭紝姣忎釜鍙嶅绁ㄤ細鐩稿簲鎵i櫎浣2涓Н鍒嗐" - -msgid "Through the votes of other people you can accumulate a maximum of 200 points." -msgstr "姣忓ぉ閫氳繃鍒汉鎶曡禐鎴愮エ锛屼綘鏈澶氬彧鑳戒骇鐢200涓Н鍒嗭紝杩欐槸涓婇檺銆" - -msgid "After accumulating certain number of points, you can do more:" -msgstr "褰撲綘绱鍒颁竴瀹>绉垎锛屼綘鍙互鍦ㄧぞ鍖哄仛鏇村鐨勪簨鎯咃細" - -msgid "upvote" -msgstr "鎶曡禐鎴愮エ" - -msgid "use tags" -msgstr "鏍囪鍨冨溇甯" - -msgid "add comment" -msgstr "娣诲姞璇勮" - -#todo - check if it's indeed plural -msgid "add comments" -msgstr "娣诲姞璇勮" - -msgid "comments" -msgstr "璇勮" - -msgid "downvote" -msgstr "鎶曞弽瀵圭エ" - -msgid "retag questions" -msgstr "缁欎换浣曢棶棰樻暣鐞嗘爣绛" - -msgid "edit community wiki questions" -msgstr "缂栬緫wiki绫婚棶棰" - -msgid "edit any answer" -msgstr "缂栬緫浠讳綍闂鎴栫瓟妗" - -msgid "reopen any closed questions" -msgstr "鎵撳紑鍏抽棴浠讳綍浜虹殑闂" - -msgid "delete any comment" -msgstr "鍒犻櫎浠讳綍涓涓瘎璁" - -msgid "delete any questions and answers and perform other moderation tasks" -msgstr "鍒犻櫎浠讳綍涓涓棶棰樻垨绛旀锛屽強鍏朵粬绠$悊鍔熻兘" - -msgid "To register, do I need to create new password?" -msgstr "鎴戦渶瑕佹敞鍐屼竴涓柊鐢ㄦ埛鍚楋紵" - -msgid "Why other people can edit my questions/answers?" -msgstr "涓轰粈涔堝叾浠栦汉鍙互淇敼鎴戠殑闂/鍥炵瓟锛" - -msgid "Still have questions?" -msgstr "杩樻湁鍏朵粬闂锛" - -msgid "Please ask your question, help make our community better!" -msgstr "濡傛灉鎮ㄥ绀惧尯杩樻湁鍏朵粬鐤戦棶锛岃涓璧锋潵瀹屽杽鎴戜滑鐨" - -msgid "No, you don't have to. You can login through any service that supports OpenID, e.g. Google, Yahoo, AOL, etc." -msgstr "涓嶉渶瑕併傜ぞ鍖烘彁渚涗簡OpenID鐨勭櫥褰曟敮鎸侊紝浣犺鐢℅oogle銆乊ahoo绛変换浣曟敮鎸丱penID鐧诲綍鐨勫笎鍙峰氨鍙互浣跨敤绯荤粺銆" - -msgid "Login now!" -msgstr "椹笂鐧诲綍" - -msgid "Login" -msgstr "鐧诲綍" - -msgid "So questions and answers can be edited like wiki pages by experienced users of this site and this improves the overall quality of the knowledge base content." -msgstr "鎵浠ラ棶棰樺拰绛旀閮芥槸濡俉iki涓鏍峰彲缂栬緫鐨勶紝鎴戜滑甯屾湜绀惧尯鑳藉府鍔╃敤鎴锋矇娣銆佺Н绱洿澶氭湁鐢ㄧ殑鐭ヨ瘑鍜岀粡楠屻" - -msgid "If this approach is not for you, we respect your choice." -msgstr "濡傛灉鎮ㄤ笉鍠滄杩欑鏂瑰紡锛屾垜浠皧閲嶄綘鐨勯夋嫨銆" - -msgid "Privacy policy" -msgstr "闅愮鏀跨瓥" - -msgid "Site Visitors" -msgstr "缃戠珯璁块棶鑰" - -msgid "Personal Information" -msgstr "涓汉韬唤淇℃伅" - -msgid "Other Services" -msgstr "鍏朵粬鏈嶅姟" - -msgid "Policy Changes" -msgstr "鏀跨瓥鏇存敼" - -msgid "Sorry, could not find the page you requested." -msgstr "瀵逛笉璧凤紝娌℃湁鎵惧埌鎮ㄨ姹傜殑椤甸潰锛" - -msgid "This might have happened for the following reasons:" -msgstr "鏈夊彲鑳芥槸浠ヤ笅鍘熷洜瀵艰嚧锛" - -msgid "this question or answer has been deleted;" -msgstr "浣犳鍦ㄦ煡鐪嬬殑闂鎴栬呭洖绛斿凡缁忚鍒犻櫎锛" - -msgid "url has error - please check it;" -msgstr "璇锋眰鐨勫湴鍧鏈夎 - 璇锋牳瀹炲師濮婾RL鍦板潃锛" - -msgid "the page you tried to visit is protected or you don't have sufficient points, see" -msgstr "璁块棶鐨勯〉闈㈣淇濇姢鎴栦綘鐨勭Н鍒嗕笉澶燂紝鍙傝" - -msgid "if you believe this error 404 should not have occured, please" -msgstr "濡傛灉浣犵‘淇′笉璇ュ嚭鐜404閿欒锛岃" - -msgid "report this problem" -msgstr "鎶ュ憡杩欎釜闂" - -msgid "back to previous page" -msgstr "杩斿洖鍓嶉〉" - -msgid "see all questions" -msgstr "鏌ョ湅鏈鏂伴棶棰" - -msgid "see all tags" -msgstr "鏌ョ湅鏍囩鍒楄〃" - -msgid "Edit answer" -msgstr "淇敼鍥炵瓟" - -msgid "hide preview" -msgstr "绂佺敤棰勮" - -msgid "show preview" -msgstr "鍚敤棰勮" - -msgid "select revision" -msgstr "閫夋嫨鐗堟湰" - -msgid "Toggle the real time Markdown editor preview" -msgstr "鎵撳紑鎴栬呭叧闂璏arkdown缂栬緫鍣ㄧ殑瀹炴椂棰勮" - -msgid "toggle preview" -msgstr "棰勮寮鍏" - -msgid "question tips" -msgstr "鍙楁杩庣殑鎻愰棶" - -msgid "answer tips" -msgstr "鍙楁杩庣殑鎻愰棶" - -msgid "try to give an answer, rather than engage into a discussion" -msgstr "寤鸿鎮ㄦ彁鐨勯棶棰樻槸鍙互琚瓟澶嶇殑锛岃屼笉浠呬粎鏄彲浠ヨ璁恒" - -msgid "please try to provide details" -msgstr "璇疯缁嗘弿杩版偍鐨勯棶棰樸" - -msgid "be clear and concise" -msgstr "鎴戜滑鎺ㄨ崘鎮ㄤ娇鐢ㄤ腑鏂囨弿杩伴棶棰橈紝杩欐牱鍙互寰楀埌鏇村鐨勭瓟澶嶆満浼氥" - -msgid "see frequently asked questions" -msgstr "鏌ョ湅甯歌闂" - -msgid "learn more about Markdown" -msgstr "鏈夊叧Markdown璇︾粏璇存槑" - -msgid "basic HTML tags are also supported" -msgstr "鍩烘湰鐨凥TML鏍囩涔熸槸鏀寔鐨" - -msgid "numbered list:" -msgstr "鍒楄〃锛" - -msgid "image" -msgstr "鍥剧墖" - -msgid "text" -msgstr "鏂囨湰" - -msgid "title" -msgstr "鏍囬" - -msgid "Markdown tips" -msgstr "Markdown蹇熷弬鑰" - -msgid "*italic* or _italic_" -msgstr "*鏂滀綋* 鎴栬 _鏂滀綋_" - -msgid "**bold** or __bold__" -msgstr "**鍔犵矖** 鎴栬 __鍔犵矖__ " - -msgid "link" -msgstr "閾炬帴" - -msgid "Badge" -msgstr "濂栫墝" - -msgid "The users have been awarded with badges:" -msgstr "鐢ㄦ埛宸茶鎺堜簣璇ュ鐗岋細" - -msgid "posts per page" -msgstr "姣忛〉鏄剧ず" - -msgid "i like this post (click again to cancel)" -msgstr "杩欑瘒甯栧瓙鏈変环鍊硷紙鍐嶆鐐瑰嚮鍙栨秷鎿嶄綔锛" - -msgid "i like this answer (click again to cancel)" -msgstr "杩欑瘒甯栧瓙鏈変环鍊硷紙鍐嶆鐐瑰嚮鍙栨秷鎿嶄綔锛" - -msgid "current number of votes" -msgstr "褰撳墠鎬荤エ鏁" - -msgid "i dont like this post (click again to cancel)" -msgstr "杩欑瘒甯栧瓙娌℃湁浠峰硷紙鍐嶆鐐瑰嚮鍙栨秷鎿嶄綔锛" - -msgid "i dont like this answer (click again to cancel)" -msgstr "杩欑瘒甯栧瓙娌℃湁浠峰硷紙鍐嶆鐐瑰嚮鍙栨秷鎿嶄綔锛" - -msgid "mark this question as favorite (click again to cancel)" -msgstr "鎴戣鏀惰棌杩欎釜闂锛堝啀娆$偣鍑诲彇娑堟搷浣滐級" - -msgid "remove favorite mark from this question (click again to restore mark)" -msgstr "鎴戣鏀惰棌杩欎釜闂锛堝啀娆$偣鍑诲彇娑堟搷浣滐級" - -msgid "delete" -msgstr "鍒犻櫎" - -#todo please check this in chinese -msgid "undelete" -msgstr "鍙栨秷" - -#: templates/unanswered.html:98 -#, python-format -msgid "have %(num_q)s unanswered questions" -msgstr "" -"鎮ㄦ鍦ㄦ祻瑙堟墍鏈
" -"
%(num_q)s
" -"涓

闂鎸 闂鍒涘缓鏃堕棿 鎺掑簭銆傛渶鏂板姞鍏ョ殑闂灏嗘樉绀哄湪鏈鍓嶉潰銆

" - -msgid "Change password" -msgstr "淇敼瀵嗙爜" - -msgid "Change email" -msgstr "鏇存崲鐢靛瓙閭欢" - -msgid "Change OpenID" -msgstr "鏇存崲OpenID鍦板潃" - -msgid "Delete account" -msgstr "鍒犻櫎甯愬彿" - -msgid "User login" -msgstr "鐢ㄦ埛鐧诲綍" - -msgid "we support two login modes" -msgstr "CNProg鏀寔涓ょ鐧诲綍妯″紡銆傛偍鍙互浣跨敤甯愬彿銆佸瘑鐮佺櫥褰曪紝鎴栬呬娇鐢∣penID鐧诲綍銆" - -msgid "Login with your OpenID" -msgstr "浣跨敤OpenID鐧诲綍" - -msgid "select openid provider" -msgstr "1)璇烽夋嫨鎮ㄧ殑甯愬彿绫伙細" - -msgid "verify openid link and login" -msgstr "2)鍨嬪苟瀹屾垚姝g‘鐨凮penID鍦板潃锛堝锛氭浛鎹⑩渰username}鈥濅负鎮ㄧ殑瀵瑰簲甯愬彿锛夛細" - -msgid "reopen" -msgstr "鎵撳紑" - -msgid "close" -msgstr "鍏抽棴" - -msgid "report as offensive (i.e containing spam, advertising, malicious text, etc.)" -msgstr "妫涓捐甯栦负鍨冣滄按甯栤濓紙鍚箍鍛娿佷汉韬敾鍑汇佹伓鎰忚█璁虹瓑锛" - -msgid "flag offensive" -msgstr "鍨冨溇甯栵紵" - -msgid "login" -msgstr "鐧诲綍" - -msgid "back to home page" -msgstr "鍥炲埌棣栭〉" - -msgid "questions" -msgstr "闂" - -msgid "tags" -msgstr "鏍囩" - -msgid "users" -msgstr "鐢ㄦ埛" - -msgid "books" -msgstr "璇讳功" - -msgid "badges" -msgstr "濂栫墝姒" - -msgid "my profile" -msgstr "鎴戠殑璧勬枡" - -msgid "ask a question" -msgstr "鎴戣鎻愰棶" - -msgid "Ask a question" -msgstr "鎴戣鎻愰棶" - -msgid "search" -msgstr "鎼滅储" - -msgid "update profile" -msgstr "鏇存柊鎴戠殑璧勬枡" - -msgid "real name" -msgstr "濮撳悕" - -msgid "member for" -msgstr "宸插姞鍏" - -msgid "ago" -msgstr "鍓" - -msgid "last seen" -msgstr "涓婃娲诲姩鏃堕棿" - -msgid "user website" -msgstr "涓汉缃戠珯" - -msgid "location" -msgstr "鍩庡競" - -#user_info.html -msgid "age" -msgstr "骞撮緞" - -msgid "age unit" -msgstr "宀" - -msgid "todays unused votes" -msgstr "浠婃棩鍓╀綑鎶曠エ鏁" - -msgid "votes left" -msgstr "绁" - -msgid "this answer has been selected as correct" -msgstr "璇ュ洖绛斿凡琚涓烘渶浣崇瓟妗" - -msgid "the answer has been voted for %d times" -msgstr "璇ュ洖绛旀诲叡鏈%d涓姇绁" - -msgid "the answer has been commented %d times" -msgstr "璇ュ洖绛旀湁%d鏉¤瘎璁" - -msgid "votes total" -msgstr "涓姇绁" - -msgid "user has voted up this many times" -msgstr "璇ョ敤鎴锋姇鐨勮禐鎴愮エ鎬绘暟" - -msgid "user has voted down this many times" -msgstr "鐢ㄦ埛鎶曠殑鍙嶅绁ㄦ绘暟" - -msgid "Tags" -msgstr "涓爣绛" - -msgid "see other questions tagged '%s'" -msgstr "鏌ョ湅鏈夊叧'%s'鐨勯棶棰" - -msgid "Badges" -msgstr "鏋氬鐗" - -msgid "Badge summary" -msgstr "濂栫墝鍒楄〃" - -msgid "Users" -msgstr "鐢ㄦ埛鍒楄〃" - -msgid "recent" -msgstr "鏈鏂板姞鍏" - -msgid "oldest" -msgstr "鏈鍏堝姞鍏" - -msgid "by username" -msgstr "鐢ㄦ埛鍚" - -msgid "user name" -msgstr "鐢ㄦ埛鍚" - -msgid "users matching query %s:" -msgstr "鍖归厤鏌ヨ '%s' 鐨勬墍鏈夌敤鎴峰悕锛" - -msgid "Below is the list of available badges and number of times each type of badge has been awarded." -msgstr "杩欓噷鍒楀嚭绀惧尯鎵鏈夌殑濂栫墝锛屼互鍙婂埌鐩墠涓烘锛屾瘡涓鐗岃鎺堜簣鐨勭敤鎴蜂汉鏁般" - -msgid "Community badges" -msgstr "绀惧尯濂栫墝" - -msgid "gold badge: the highest honor and is very rare" -msgstr "閲戠墝:鍗佸垎缃曡涔嬫渶楂樿崳鑰" - -msgid "silver badge: occasionally awarded for the very high quality contributions" -msgstr "閾剁墝:鍋跺皵棰佸彂涔嬩紭璐ㄥ绔" - -msgid "gold" -msgstr "閲戠墝" - -msgid "Gold badge is very rare." -msgstr "閲戠墝鏄崄鍒嗙綍瑙佺殑銆" - -msgid "To obtain it you have to show profound knowledge and ability in addition to actively participating in the community." -msgstr "浣犱笉浠呰鍙備笌绀惧尯鐨勬彁闂佸洖绛斻佹姇绁ㄧ瓑娲诲姩锛岃屼笖闇瑕佹湁楂樻繁鐨勭煡璇嗗拰鑳藉姏鎵嶈兘鑾峰緱銆" - -msgid "Gold badge is the highest award in this community." -msgstr "鑾峰緱閲戠墝鎰忓懗鐫浣犲湪鏌愪釜灞傛涓婂凡缁忚揪鍒颁簡椤跺嘲銆" - -msgid "silver" -msgstr "閾剁墝" - -msgid "Obtaining silver badge requires significant patience." -msgstr "閾剁墝闇瑕佺粡杩囬暱鏃堕棿鐨勫鏂楁墠鑳借幏寰椼" - -msgid "If you got one, you have very significantly contributed to this community" -msgstr "瀹冩槸涓嶅悓瀵诲父鐨勮崳瑾夛紝鍙浣犱粯鍑鸿冻澶熺殑鍔姏灏变細寰楀埌銆" - -msgid "bronze badge: often given as a special honor" -msgstr "閾滅墝:鏃跺父鎺堜簣涔嬬壒娈婅崳瑾" - -msgid "If you are active in this community, you will will get this medal - still it is a special honor." -msgstr "閾滅墝浼氬湪浣犳椿璺冧簬绀惧尯鏃朵骇鐢燂紝瀹冪浉瀵瑰鏄撹幏寰楋紝浣嗕篃鏄竴绉嶇壒娈婄殑鑽h獕銆" - -msgid "Use" -msgstr "浣跨敤" - -msgid "learn more about OpenID" -msgstr "浜嗚В鏇村鏈夊叧OpenID鐨勪俊鎭" - -msgid "Get your own" -msgstr "鑾峰彇鎮ㄨ嚜宸辩殑" - -msgid "User name" -msgstr "鎮ㄧ殑澶у悕" - -msgid "Email: (won't be shown to anyone)" -msgstr "鐢靛瓙閭欢:锛堜笉浼氬叕寮鏄剧ず锛" - -msgid "Ask your question" -msgstr "鐜板湪鎻愰棶" - -#page title -msgid "Edit question" -msgstr "淇敼闂" - -msgid "The question has been closed for the following reason \"%s\" by" -msgstr "闂浠モ%s鈥濈殑鍘熷洜宸茶" - -msgid "%s ago" -msgstr "浜%s鍏抽棴" - -msgid "oldest answers" -msgstr "鏈鍏堝洖绛" - -msgid "newest answers" -msgstr "鏈杩戝洖绛" - -msgid "popular answers" -msgstr "鎶曠エ鏈澶" - -msgid "oldest answers will be shown first" -msgstr "鏈鍏堝洖绛旀樉绀哄湪鏈鍓嶉潰" - -msgid "newest answers will be shown first" -msgstr "鏈鏅氬洖绛旀樉绀哄湪鏈鍓嶉潰" - -msgid "most voted answers will be shown first" -msgstr "鎶曠エ娆℃暟鏈澶氱殑鏄剧ず鍦ㄦ渶鍓嶉潰" - -msgid "mark this answer as favorite (click again to undo)" -msgstr "鏈浣崇瓟妗堬紙鍐嶆鐐瑰嚮鍙栨秷鎿嶄綔锛" - -msgid "the author of the question has selected this answer as correct" -msgstr "杩欎釜绛旀宸茬粡琚彁闂綔鑰呮爣璁颁负鏈浣崇瓟妗" - -msgid "answer permanent link" -msgstr "璇ュ洖绛旂殑閾炬帴鍦板潃" - -msgid "permanent link" -msgstr "姘镐箙閾炬帴" - -msgid "Your answer" -msgstr "鎮ㄧ殑鍥炵瓟" - -msgid "Answer the question" -msgstr "鍥炵瓟璇ラ棶棰" - -msgid "Login to answer" -msgstr "鐧诲綍骞跺洖绛旇闂" - -msgid "Question tags" -msgstr "鎮ㄦ鍦ㄦ祻瑙堢殑闂鍚湁浠ヤ笅鏍囩" - -msgid "Question asked" -msgstr "鎻愰棶鏃堕棿" - -msgid "question was seen" -msgstr "鐩墠娴忚鏁伴噺" - -msgid "times" -msgstr "娆" - -msgid "last updated" -msgstr "鏈鍚庢洿鏂版椂闂" - -msgid "related questions" -msgstr "鐩镐技鐨勯棶棰" - -msgid "profile - responses" -msgstr "鍥炲簲 - 鐢ㄦ埛璧勬枡" - -msgid "user reputation in the community" -msgstr "鐢ㄦ埛绀惧尯绉垎" - -msgid "profile - user reputation" -msgstr "绉垎 - 鐢ㄦ埛璧勬枡" - -msgid "profile - favorite questions" -msgstr "鏀惰棌 - 鐢ㄦ埛璧勬枡" - -msgid "profile - votes" -msgstr "鎶曠エ - 鐢ㄦ埛璧勬枡" - -msgid "profile - user preferences" -msgstr "璁剧疆 - 鐢ㄦ埛璧勬枡" - -msgid "uploading images is limited to users with >60 reputation points" -msgstr "涓婁紶鍥剧墖鍙檺浜庣Н鍒+60浠ヤ笂娉ㄥ唽鐢ㄦ埛!" - -#todo take these out of settings -msgid "allowed file types are 'jpg', 'jpeg', 'gif', 'bmp', 'png', 'tiff'" -msgstr "鍙厑璁镐笂浼'jpg', 'jpeg', 'gif', 'bmp', 'png', 'tiff'绫诲瀷鐨勬枃浠讹紒" - -msgid "maximum upload file size is %sK" -msgstr "鍙厑璁镐笂浼%sK澶у皬鐨勬枃浠讹紒" - -msgid "Error uploading file. Please contact the site administrator. Thank you." -msgstr "鍦ㄦ枃浠朵笂浼犺繃绋嬩腑浜х敓浜嗛敊璇紝璇疯仈绯荤鐞嗗憳锛岃阿璋_^" - -msgid "please enter a descriptive title for your question" -msgstr "璇疯緭鍏ュ闂鍏锋湁鎻忚堪鎬ц川鐨勬爣棰 - 鈥滃府蹇欙紒绱фユ眰鍔╋紒鈥濅笉鏄缓璁殑鎻愰棶鏂瑰紡銆" - -msgid "title must be > 10 characters" -msgstr "鏍囬鐨勯暱搴﹀繀椤诲ぇ浜10" - -msgid "content" -msgstr "鍐呭" - -msgid "question content must be > 10 characters" -msgstr "鍐呭鑷冲皯瑕10涓瓧绗" - -msgid "please use space to separate tags (this enables autocomplete feature)" -msgstr "澶氫釜鏍囩璇风敤绌烘牸闂撮殧-鏈澶5涓爣绛俱傦紙浼樺厛浣跨敤鑷姩鍖归厤鐨勮嫳鏂囨爣绛俱傦級" - -msgid "tags must be shorter than 20 characters" -msgstr "姣忎釜鏍囩鐨勯暱搴︿笉瓒呰繃20" - -msgid "please use following characters in tags: letters 'a-z', numbers, and characters '.-_#'" -msgstr "鏍囩璇蜂娇鐢ㄨ嫳鏂囧瓧姣嶏紝涓枃鎴栬呮暟瀛楀瓧绗︿覆锛. - _ # 涔熷彲浠ワ級" - -msgid "if you choose community wiki option, the question and answer do not generate points and name of author will not be shown" -msgstr "閫夋嫨绀惧尯wiki妯″紡锛岄棶绛斾笉璁$畻绉垎锛岀鍚嶄篃涓嶆樉绀轰綔鑰呬俊鎭" - -msgid "update summary:" -msgstr "鏇存柊姒傝锛" - -msgid "enter a brief summary of your revision (e.g. fixed spelling, grammar, improved style, this field is optional)" -msgstr "杈撳叆鏈淇敼鐨勭畝鍗曟杩帮紙濡傦細淇敼浜嗗埆瀛楋紝淇浜嗚娉曪紝鏀硅繘浜嗘牱寮忕瓑銆傞潪蹇呭~椤广傦級" - -msgid "this email does not have to be linked to gravatar" -msgstr "涓嶄細鍏紑锛岀敤浜庡ご鍍忔樉绀烘湇鍔" - -msgid "Real name" -msgstr "鐪熷疄濮撳悕" - -msgid "Website" -msgstr "涓汉缃戠珯" - -msgid "Location" -msgstr "鍩庡競" - -msgid "Date of birth" -msgstr "鐢熸棩" - -msgid "will not be shown, used to calculate age, format: YYYY-MM-DD" -msgstr "涓嶄細鍏紑锛屽彧浼氭樉绀烘偍鐨勫勾榫勶紝鏍煎紡涓猴細YYYY-MM-DD" - -msgid "Profile" -msgstr "涓汉绠浠" - -msgid "this email has already been registered, please use another one" -msgstr "璇ョ數瀛愰偖浠跺凡琚敞鍐岋紝璇烽夋嫨鍙︿竴涓啀璇曘" - -msgid "duplicate question" -msgstr "瀹屽叏閲嶅鐨勯棶棰" - -msgid "too subjective and argumentative" -msgstr "澶富瑙傛с佸紩璧蜂簤鍚电殑闂" - -msgid "is not an answer to the question" -msgstr "涓嶆槸涓涓彲浠ュ洖绛旂殑鈥滈棶棰樷" - -msgid "the question is answered, right answer was accepted" -msgstr "闂宸茬粡瑙e喅锛屽凡寰楀埌姝g‘绛旀" - -msgid "problem is not reproducible or outdated" -msgstr "宸茬粡杩囨椂銆佷笉鍙噸鐜扮殑闂" - -msgid "question contains offensive inappropriate, or malicious remarks" -msgstr "鎭舵剰瑷璁" - -msgid "spam or advertising" -msgstr "鍨冨溇骞垮憡" - -msgid "question" -msgstr "鎻愰棶" - -msgid "answer" -msgstr "鍥炵瓟" - -msgid "commented question" -msgstr "璇勮闂" - -msgid "edited question" -msgstr "淇敼闂" - -msgid "edited answer" -msgstr "淇敼鍥炵瓟" - -msgid "received award" -msgstr "鑾峰" - -msgid "marked best answer" -msgstr "鏍囪鏈浣崇瓟妗" - -msgid "upvoted" -msgstr "鎶曡禐鎴愮エ" - -msgid "downvoted" -msgstr "鎶曞弽瀵圭エ" - -msgid "canceled vote" -msgstr "鎾ら攢鎶曠エ" - -msgid "deleted question" -msgstr "鍒犻櫎闂" - -msgid "deleted answer" -msgstr "鍒犻櫎鍥炵瓟" - -msgid "marked offensive" -msgstr "鏍囪鍨冨溇甯" - -msgid "updated tags" -msgstr "鏇存柊鏍囩" - -msgid "selected favorite" -msgstr "鏀惰棌" - -msgid "completed user profile" -msgstr "瀹屾垚涓汉鎵鏈夎祫鏂" - -msgid "[closed]" -msgstr "[宸插叧闂璢" - -msgid "[deleted]" -msgstr "[宸插垹闄" - -msgid "initial version" -msgstr "鍒濆鐗堟湰" - -msgid "retagged" -msgstr "鏇存柊浜嗘爣绛" - -#todo: review this message may be confusing user -msgid "This account already exists, please use another." -msgstr "杈撳叆鎮ㄧ殑鏂板笎鍙锋垨鑰呮寚瀹氬凡缁忓瓨鍦ㄧ殑甯愬彿銆" - -msgid "Sorry, looks like we have some errors:" -msgstr "璇锋敞鎰忎互涓嬮敊璇細" - -msgid "New account" -msgstr "鏂板笎鍙" - -msgid "Use login name and password" -msgstr "浣跨敤甯愬彿瀵嗙爜鐧诲綍" - -msgid "User name (will be shown to others, cannot be modified)" -msgstr "鐢ㄦ埛鍚嶏紙鍦ㄧぞ鍖烘樉绀哄弸濂藉悕绉帮紝涓嶅彲鏇存敼锛" - -msgid "Email (not shared with anyone)" -msgstr "鐢靛瓙閭欢锛鐢ㄤ簬澶村儚鏄剧ず鏈嶅姟锛" - -msgid "create account" -msgstr "鍒涘缓甯愬彿" - -msgid "Existing account" -msgstr "宸茬粡瀛樺湪鐨勭敤鎴" - -msgid "password" -msgstr "瀵嗙爜" - -msgid "Password" -msgstr "瀵嗙爜" - -msgid "Register" -msgstr "纭" - -msgid "Forgot your password?" -msgstr "蹇樿瀵嗙爜锛" - -msgid "Create new account" -msgstr "娉ㄥ唽鏂板笎鍙" - -msgid "Send new password" -msgstr "鍙戦佹柊瀵嗙爜" - -msgid "Lost your password? No problem - here you can reset it." -msgstr "涓㈠け浜嗘偍鐨勫瘑鐮侊紵 浣犲彲浠ュ湪杩欓噷閲嶈瀵嗙爜銆" - -msgid "Please enter your username below and new password will be sent to your registered e-mail" -msgstr "璇疯緭鍏ョ敤鎴峰悕锛屾柊鐨勫瘑鐮佷細鍙戦佸埌浣犳敞鍐屾椂鍊欏~鍐欑殑鐢靛瓙閭欢銆" - -msgid "Reset password" -msgstr "閲嶈瀵嗙爜" - -msgid "return to login" -msgstr "杩斿洖鐧诲綍" - -msgid "back to login" -msgstr "杩斿洖鐧诲綍" - -#todo - check translation or see if it's indeed true -msgid "Note: your new password will be activated only after you click the activation link in the email message" -msgstr "娉ㄦ剰: 鏂扮殑瀵嗙爜鍙湁鎮ㄥ湪婵娲婚偖浠朵腑鐨勯摼鎺ュ悗鎵嶄細琚縺娲汇" - -msgid "Signup" -msgstr "娉ㄥ唽甯愬彿" - -msgid "We support two types of user registration: conventional username/password, and" -msgstr "鎴戜滑鏀寔涓ょ娉ㄥ唽鏂瑰紡锛屼綘鍙互浣跨敤甯歌鐨勭敤鎴峰悕銆佸瘑鐮佹柟寮忔敞鍐岋紝鎴栬" - -msgid "the OpenID method" -msgstr "浣跨敤OpenID甯愬彿娉ㄥ唽" - -msgid "Conventional registration" -msgstr "璇锋敞鎰忎互涓嬮敊璇細" - -msgid "choose a user name" -msgstr "閫夋嫨涓涓敤鎴峰悕" - -msgid "your email address" -msgstr "鎮ㄧ殑鐢靛瓙閭欢鍦板潃" - -msgid "choose password" -msgstr "瀵嗙爜" - -msgid "retype password" -msgstr "纭瀵嗙爜" - -msgid "Register with your OpenID" -msgstr "浣跨敤OpenID娉ㄥ唽" - -msgid "sorry, this name can not be used, please try another" -msgstr "瀵逛笉璧凤紝鎮ㄤ笉鑳芥敞鍐岃鐢ㄦ埛鍚嶏紝璇锋崲涓涓瘯璇" - -msgid "this name is already in use - please try anoter" -msgstr "璇ョ敤鎴峰悕宸茶娉ㄥ唽锛岃鎹竴涓瘯璇" - -msgid "Why use OpenID?" -msgstr "涓轰粈涔堥渶瑕丱penID鐧诲綍锛" - -msgid "with openid it is easier" -msgstr "鏋勫缓鍦∣penID缃戠粶璁よ瘉涓婄殑鏈郴缁燂紝涓嶉渶瑕佷綘娉ㄥ唽鏂扮殑甯愬彿锛屽嵆鍙娇鐢ㄦ垜浠郴缁熺殑鎵鏈夊姛鑳" - -msgid "openid is supported open standard" -msgstr "OpenID鏄湁寮鏀炬爣鍑嗭紝骞朵笖鏈夌浉鍏崇殑鍩洪噾缁勭粐鎻愪緵鏀寔" - -msgid "Find out more" -msgstr "鏌ョ湅鏇村" - -msgid "Get OpenID" -msgstr "鑾峰彇OpenID" - -msgid "openid is widely adopted" -msgstr "鍏ㄤ笘鐣屾湁1.6浜縊penID甯愬彿锛屽拰10,000涓敮鎸丱penID鐨勭珯鐐" - -msgid "reuse openid" -msgstr "鐢ㄥ悓涓涓笎鍙峰彲鐧诲綍浜掕仈缃戞墍鏈夋縺娲籓penID鐨勭綉绔" diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo deleted file mode 100644 index 3b86743b..00000000 Binary files a/locale/zh_CN/LC_MESSAGES/django.mo and /dev/null differ diff --git a/locale/zh_CN/LC_MESSAGES/django.po b/locale/zh_CN/LC_MESSAGES/django.po deleted file mode 100644 index 160a3a64..00000000 --- a/locale/zh_CN/LC_MESSAGES/django.po +++ /dev/null @@ -1,594 +0,0 @@ -# Chinese translations for CNProg.com -# Copyright (C) 2009 -# This file is distributed under the same license as the CNPROG package. -# Mike Chen , 2009. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-07-09 15:42+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: settings.py:12 -msgid "account/" -msgstr "" - -#: settings.py:12 django_authopenid/urls.py:9 django_authopenid/urls.py:11 -msgid "signin/" -msgstr "" - -#: django_authopenid/forms.py:67 django_authopenid/views.py:93 -msgid "i-names are not supported" -msgstr "i-names涓嶆敮鎸併" - -#: django_authopenid/forms.py:102 django_authopenid/forms.py:207 -msgid "" -"Usernames can only contain letters, numbers and " -"underscores" -msgstr "鐢ㄦ埛鍚嶆牸寮忔湁璇傚彧鏈夊瓧姣嶏紝鏁板瓧鍜屼笅鍒掔嚎鏄厑璁哥殑銆" - -#: django_authopenid/forms.py:109 -msgid "" -"This username does not exist in our database. Please " -"choose another." -msgstr "鐢ㄦ埛鍚嶄笉瀛樺湪銆傝閲嶆柊杈撳叆銆" - -#: django_authopenid/forms.py:126 django_authopenid/forms.py:231 -msgid "" -"Please enter a valid username and password. Note that " -"both fields are case-sensitive." -msgstr "璇疯緭鍏ョ敤鎴峰悕鍜屽瘑鐮併傛敞鎰忓尯鍒嗗ぇ灏忓啓銆" - -#: django_authopenid/forms.py:130 django_authopenid/forms.py:235 -msgid "This account is inactive." -msgstr "鐢ㄦ埛宸插喕缁撱" - -#: django_authopenid/forms.py:184 -msgid "" -"This email is already registered in our database. Please " -"choose another." -msgstr "鐢靛瓙閭欢宸茶娉ㄥ唽銆傝浣跨敤涓涓柊鐨勯偖浠跺湴鍧銆" - -#: django_authopenid/forms.py:214 -msgid "" -"This username don't exist. Please choose another." -msgstr "鐢ㄦ埛鍚嶄笉瀛樺湪" - -#: django_authopenid/forms.py:330 -msgid "" -"Old password is incorrect. Please enter the correct " -"password." -msgstr "鏃у瘑鐮侀敊璇" - -#: django_authopenid/forms.py:342 -msgid "new passwords do not match" -msgstr "鏂板瘑鐮佷笉鍖归厤" - -#: django_authopenid/forms.py:434 -msgid "Incorrect username." -msgstr "鐢ㄦ埛鍚嶄笉姝g‘" - -#: django_authopenid/urls.py:10 -msgid "signout/" -msgstr "" - -#: django_authopenid/urls.py:11 -msgid "complete/" -msgstr "" - -#: django_authopenid/urls.py:13 -msgid "register/" -msgstr "" - -#: django_authopenid/urls.py:14 -msgid "signup/" -msgstr "" - -#: django_authopenid/urls.py:16 -msgid "sendpw/" -msgstr "" - -#: django_authopenid/urls.py:26 -msgid "delete/" -msgstr "" - -#: django_authopenid/views.py:99 -#, python-format -msgid "闈炴硶OpenID鍦板潃锛 %s" -msgstr "" - -#: django_authopenid/views.py:366 templates/index.html:78 -msgid "Welcome" -msgstr "娆㈣繋" - -#: django_authopenid/views.py:456 -msgid "Password changed." -msgstr "瀵嗙爜宸叉洿鏂般" - -#: django_authopenid/views.py:488 -msgid "Email changed." -msgstr "閭欢鍦板潃宸叉洿鏂般" - -#: django_authopenid/views.py:519 django_authopenid/views.py:671 -#, python-format -msgid "No OpenID %s found associated in our database" -msgstr "璇penID %s 涓嶅湪绯荤粺涓" - -#: django_authopenid/views.py:523 django_authopenid/views.py:678 -#, python-format -msgid "The OpenID %s isn't associated to current user logged in" -msgstr "OpenID %s 娌℃湁鍜屽綋鍓嶇櫥褰曠敤鎴风粦瀹氥" - -#: django_authopenid/views.py:531 -msgid "Email Changed." -msgstr "閭欢鍦板潃宸叉洿鏂般" - -#: django_authopenid/views.py:606 -msgid "This OpenID is already associated with another account." -msgstr "杩欎釜OpenID宸茬粡缁戝畾鍒板彟澶栦竴涓笎鍙枫" - -#: django_authopenid/views.py:611 -#, python-format -msgid "OpenID %s is now associated with your account." -msgstr "OpenID %s 宸茬粡缁戝畾鍒版偍鐨勫笎鍙枫" - -#: django_authopenid/views.py:681 -msgid "Account deleted." -msgstr "甯愬彿宸插垹闄ゃ" - -#: django_authopenid/views.py:721 -msgid "Request for new password" -msgstr "鎵惧洖瀵嗙爜" - -#: django_authopenid/views.py:734 -msgid "A new password has been sent to your email address." -msgstr "鏂扮殑瀵嗙爜宸茬粡鍙戦佸埌鎮ㄧ殑閭欢甯愬彿銆" - -#: django_authopenid/views.py:764 -#, python-format -msgid "" -"Could not change password. Confirmation key '%s' is not " -"registered." -msgstr "涓嶈兘淇敼瀵嗙爜銆傜‘璁や俊鎭 '%s' 鏈夎銆" - -#: django_authopenid/views.py:773 -msgid "" -"Can not change password. User don't exist anymore in our " -"database." -msgstr "涓嶈兘淇敼瀵嗙爜銆傜敤鎴峰笎鍙蜂笉瀛樺湪銆" - -#: django_authopenid/views.py:782 -#, python-format -msgid "Password changed for %s. You may now sign in." -msgstr "甯愬彿 %s 鐨勫瘑鐮佸凡缁忎慨鏀广傛偍鐜板湪鍙互鐢ㄥ畠鏉ョ櫥褰曘" - -#: forum/user.py:17 -msgid "Overview" -msgstr "姒傝" - -#: forum/user.py:18 -msgid "User overview" -msgstr "鐢ㄦ埛姒傝" - -#: forum/user.py:19 -msgid "Overview - User Profile" -msgstr "姒傝-鐢ㄦ埛璧勬枡" - -#: forum/user.py:25 -msgid "Recent" -msgstr "鏈杩戞椿鍔" - -#: forum/user.py:26 -msgid "Recent activities" -msgstr "鐢ㄦ埛鏈杩戞椿鍔ㄦ儏鍐" - -#: forum/user.py:27 -msgid "Recent - User Profile" -msgstr "鏈杩戞椿鍔-鐢ㄦ埛璧勬枡" - -#: forum/user.py:34 -msgid "Response" -msgstr "鍥炲簲" - -#: forum/user.py:35 -msgid "Responses from others" -msgstr "鍏朵粬鐢ㄦ埛鐨勫洖绛斿拰璇勮" - -#: forum/user.py:36 -msgid "Response - User Profile" -msgstr "鍥炲簲-鐢ㄦ埛璧勬枡" - -#: forum/user.py:43 -msgid "Reputation" -msgstr "绉垎" - -#: forum/user.py:44 -msgid "Community reputation" -msgstr "绀惧尯绉垎" - -#: forum/user.py:45 -msgid "Reputation - User Profile" -msgstr "绉垎-鐢ㄦ埛璧勬枡" - -#: forum/user.py:51 -msgid "Favorites" -msgstr "鏀惰棌" - -#: forum/user.py:52 -msgid "User's favorite questions" -msgstr "鐢ㄦ埛鏀惰棌鐨勯棶棰" - -#: forum/user.py:53 -msgid "Favorites - User Profile" -msgstr "鏀惰棌-鐢ㄦ埛璧勬枡" - -#: forum/user.py:60 templates/index.html:46 -msgid "Votes" -msgstr "鎶曠エ" - -#: forum/user.py:61 -msgid "Votes history" -msgstr "鐢ㄦ埛鎶曠エ鍘嗗彶" - -#: forum/user.py:62 -msgid "Votes - User Profile" -msgstr "鎶曠エ-鐢ㄦ埛璧勬枡" - -#: forum/user.py:69 -msgid "Preferences" -msgstr "璁剧疆" - -#: forum/user.py:70 -msgid "User preferences" -msgstr "鐢ㄦ埛鍙傛暟璁剧疆" - -#: forum/user.py:71 -msgid "Preferences - User Profile" -msgstr "璁剧疆-鐢ㄦ埛璧勬枡" - -#: templates/badges.html:5 templates/badges.html.py:16 -#: templates/header.html:31 -msgid "Badges" -msgstr "濂栫墝姒" - -#: templates/base.html:53 templates/base_content.html:52 -msgid "Congratulations! You have new badges: " -msgstr "鎭枩鎮ㄨ鎺堜簣濂栫墝锛" - -#: templates/base.html:54 templates/base_content.html:53 -msgid "go to see" -msgstr "鏌ョ湅" - -#: templates/base.html:55 templates/base_content.html:54 -#: templates/header.html:35 -msgid "Profile" -msgstr "鎴戠殑璧勬枡" - -#: templates/footer.html:5 templates/header.html:10 templates/index.html:81 -msgid "About us" -msgstr "鍏充簬鎴戜滑" - -#: templates/footer.html:6 templates/header.html:11 -msgid "faq" -msgstr "甯歌闂" - -#: templates/footer.html:8 -msgid "Contact" -msgstr "鑱旂郴鎴戜滑" - -#: templates/footer.html:9 -msgid "Privacy" -msgstr "闅愮鏀跨瓥" - -#: templates/footer.html:10 -msgid "Feedback" -msgstr "鐢ㄦ埛鍙嶉" - -#: templates/header.html:6 templates/logout.html:5 templates/logout.html.py:16 -msgid "Logout" -msgstr "閫鍑虹櫥褰" - -#: templates/header.html:8 -msgid "Login" -msgstr "鐧诲綍" - -#: templates/header.html:21 -msgid "link to homepage" -msgstr "杩斿洖棣栭〉" - -#: templates/header.html:27 templates/header.html.py:56 -#: templates/index.html:21 -msgid "Questions" -msgstr "闂" - -#: templates/header.html:28 templates/header.html.py:57 -msgid "Tags" -msgstr "鏍囩" - -#: templates/header.html:29 templates/header.html.py:58 -msgid "Users" -msgstr "鐢ㄦ埛" - -#: templates/header.html:30 -msgid "Books" -msgstr "璇讳功" - -#: templates/header.html:32 -msgid "Unanswered" -msgstr "娌℃湁鍥炵瓟鐨勯棶棰" - -#: templates/header.html:38 -msgid "Ask a question" -msgstr "鎴戣鎻愰棶" - -#: templates/header.html:53 -msgid "Search" -msgstr "鎼滅储" - -#: templates/index.html:6 -msgid "Home" -msgstr "棣栭〉" - -#: templates/index.html:23 -msgid "Newest updated questions" -msgstr "鏈鏂版洿鏂扮殑闂" - -#: templates/index.html:23 -msgid "Newest" -msgstr "鏈鏂伴棶棰" - -#: templates/index.html:24 -msgid "Questions with most answers" -msgstr "琚洖澶嶆渶澶氱殑闂" - -#: templates/index.html:24 -msgid "Hottest" -msgstr "鏈鐑棶棰" - -#: templates/index.html:25 -msgid "Questions with most votes" -msgstr "琚姇绁ㄦ渶澶氱殑闂" - -#: templates/index.html:25 -msgid "Best" -msgstr "鏈鏈変环鍊奸棶棰" - -#: templates/index.html:26 templates/index.html.py:118 -msgid "All questions" -msgstr "鎵鏈夐棶棰" - -#: templates/index.html:26 -msgid "All" -msgstr "鎵鏈夐棶棰" - -#: templates/index.html:45 -msgid "Answers" -msgstr "鍥炵瓟" - -#: templates/index.html:47 -msgid "Visits" -msgstr "璁块棶" - -#: templates/index.html:55 -msgid "Community wiki" -msgstr "绀惧尯wiki" - -#: templates/index.html:67 templates/index.html.py:91 -msgid "Browse questions with tag of " -msgstr "鏌ョ湅鎵鏈変互涓嬩富棰橀棶棰橈細" - -#: templates/index.html:87 -msgid "Recent tags" -msgstr "鏈鏂版爣绛" - -#: templates/index.html:94 templates/index.html.py:118 -msgid "Popular tags" -msgstr "鍙楁杩庣殑鏍囩" - -#: templates/index.html:98 -msgid "Recent badges" -msgstr "鏈鏂板鐗" - -#: templates/index.html:109 -msgid "All badges" -msgstr "鎵鏈夊鐗" - -#: templates/index.html:113 -msgid "RSS feed of recent 30 questions" -msgstr "RSS璁㈤槄鏈鏂30涓棶棰" - -#: templates/index.html:113 -msgid "Subscribe" -msgstr "璁㈤槄鏈鏂伴棶棰" - -#: templates/index.html:118 -msgid "Are you looking for more questions? Try to browse" -msgstr "鍦ㄥ鎵炬洿澶氶棶棰樺悧锛熻鏌ラ槄" - -#: templates/index.html:118 -msgid " or " -msgstr " 鎴栬 " - -#: templates/index.html:118 -msgid ". Please help us answer " -msgstr "銆傝甯姪鎴戜滑鍥炵瓟" - -#: templates/index.html:118 -msgid "Unanswered questions" -msgstr "娌℃湁鍥炵瓟鐨勯棶棰" - -#: templates/authopenid/changeemail.html:10 -msgid "Account: change email" -msgstr "淇敼鐢靛瓙閭欢" - -#: templates/authopenid/changeemail.html:13 -msgid "" -"This is where you can change the email address associated with your account. " -"Please keep this email address up to date so we can send you a password-" -"reset email if you request one." -msgstr "" -"鎮ㄥ彲浠ュ湪杩欓噷淇敼鎮ㄧ殑鐢靛瓙閭欢锛岃纭繚杩欎釜閭欢鍦板潃鏈夋晥-鎵惧洖瀵嗙爜灏嗗彂閫佹柊瀵嗙爜鍒版偍" -"鐨勯偖浠跺湴鍧銆" - -#: templates/authopenid/changeemail.html:15 -#: templates/authopenid/changeopenid.html:13 -#: templates/authopenid/changepw.html:18 templates/authopenid/delete.html:14 -#: templates/authopenid/delete.html:24 -msgid "Please correct errors below:" -msgstr "璇锋敼姝d互涓嬮敊璇細" - -#: templates/authopenid/changeemail.html:32 -msgid "Email" -msgstr "鐢靛瓙閭欢" - -#: templates/authopenid/changeemail.html:33 -msgid "Password" -msgstr "瀵嗙爜" - -#: templates/authopenid/changeemail.html:35 -msgid "Change email" -msgstr "淇敼鐢靛瓙閭欢" - -#: templates/authopenid/changeopenid.html:7 -msgid "Account: change OpenID URL" -msgstr "淇敼OpenID鍦板潃" - -#: templates/authopenid/changeopenid.html:11 -msgid "" -"This is where you can change your OpenID URL. Make sure you remember it!" -msgstr "璇蜂慨鏀规偍鐨凮penID鍦板潃锛岃涓嶈蹇樿杩欎釜鍦板潃锛" - -#: templates/authopenid/changeopenid.html:28 -msgid "OpenID URL:" -msgstr "OpenID鍦板潃锛" - -#: templates/authopenid/changeopenid.html:29 -msgid "Change OpenID" -msgstr "淇敼OpenID" - -#: templates/authopenid/changepw.html:13 -msgid "Account: change password" -msgstr "淇敼瀵嗙爜" - -#: templates/authopenid/changepw.html:16 -msgid "This is where you can change your password. Make sure you remember it!" -msgstr "璇蜂慨鏀规偍鐨勫瘑鐮侊紝鍒囪涓嶈蹇樿锛" - -#: templates/authopenid/changepw.html:26 -msgid "Current password" -msgstr "鏃у瘑鐮" - -#: templates/authopenid/changepw.html:27 -msgid "New password" -msgstr "鏂板瘑鐮" - -#: templates/authopenid/changepw.html:28 -msgid "New password again" -msgstr "閲嶅瀵嗙爜" - -#: templates/authopenid/changepw.html:29 -msgid "Change password" -msgstr "淇敼瀵嗙爜" - -#: templates/authopenid/delete.html:8 -msgid "Account: delete account" -msgstr "鍒犻櫎甯愬彿" - -#: templates/authopenid/delete.html:12 -msgid "" -"Note: After deleting your account, anyone will be able to register this " -"username." -msgstr "娉ㄦ剰锛氬垹闄ゆ偍鐨勫笎鍙峰悗锛屼换浣曞叾浠栦汉鍙互鍐嶆敞鍐岃繖涓笎鍙枫" - -#: templates/authopenid/delete.html:16 -msgid "Check confirm box, if you want delete your account." -msgstr "濡傛灉纭畾鍒犻櫎锛岃閫変腑澶氶夋銆" - -#: templates/authopenid/delete.html:19 -msgid "Password:" -msgstr "瀵嗙爜锛" - -#: templates/authopenid/delete.html:31 -msgid "I am sure I want to delete my account." -msgstr "鎴戠‘璁よ鍒犻櫎杩欎釜甯愬彿銆" - -#: templates/authopenid/delete.html:32 -msgid "Password/OpenID URL" -msgstr "瀵嗙爜/OpenID鍦板潃" - -#: templates/authopenid/delete.html:32 -msgid "(required for your security)" -msgstr "锛堝繀闇锛" - -#: templates/authopenid/delete.html:34 -msgid "Delete account permanently" -msgstr "姘镐箙鍒犻櫎甯愬彿" - -#: templates/authopenid/settings.html:29 -msgid "Give your account a new password." -msgstr "淇敼瀵嗙爜" - -#: templates/authopenid/settings.html:31 -msgid "Add or update the email address associated with your account." -msgstr "娣诲姞鎴栬呮洿鏂版偍鐨勯偖浠跺湴鍧銆" - -#: templates/authopenid/settings.html:34 -msgid "Change openid associated to your account" -msgstr "淇敼鍜屼綘甯愬彿缁戝畾鐨凮penID鍦板潃" - -#: templates/authopenid/settings.html:38 -msgid "Erase your username and all your data from website" -msgstr "鍒犻櫎鎮ㄧ殑甯愬彿鍜屾墍鏈夊唴瀹" - -#, fuzzy -#~ msgid "Badges " -#~ msgstr "濂栫墝鍒楄〃" - -#~ msgid "" -#~ "This username is already taken. Please choose another." -#~ msgstr "鐢ㄦ埛鍚嶅凡缁忚娉ㄥ唽锛岃閫夌敤涓涓柊鐨勫笎鍙枫" - -#~ msgid "Your OpenID is verified! " -#~ msgstr "鎮ㄧ殑OpenID甯愬彿宸茬粡楠岃瘉閫氳繃" - -#~ msgid "Associate your OpenID" -#~ msgstr "缁戝畾鎮ㄧ殑OpenID" - -#~ msgid "" -#~ "\n" -#~ "\t

If you're joining Sitename, associate your OpenID " -#~ "with a new account. If you're already a member, associate with your " -#~ "existing account.

\n" -#~ "\t" -#~ msgstr "" -#~ "\n" -#~ "\t

杈撳叆鎮ㄧ殑鏂板笎鍙锋垨鑰呮寚瀹氬凡缁忓瓨鍦ㄧ殑甯愬彿銆

\n" -#~ "\t" - -#~ msgid "A new account" -#~ msgstr "鏂板笎鍙" - -#~ msgid "An exisiting account" -#~ msgstr "宸茬粡瀛樺湪鐨勫笎鍙" - -#~ msgid "Account: Send a new password" -#~ msgstr "鍙戦佷竴涓柊鐨勫瘑鐮" - -#~ msgid "" -#~ "Lost your password ? Here you can ask to reset your password. Enter the " -#~ "username you use and you will get a confirmation email with your new " -#~ "password. This new password will be activated only after you have clicked " -#~ "on the link in the email." -#~ msgstr "" -#~ "涓㈠け浜嗘偍鐨勫瘑鐮侊紵浣犲彲浠ュ湪杩欓噷閲嶈瀵嗙爜銆傝緭鍏ョ敤鎴峰悕浣犱細鏀跺埌鏂扮殑瀵嗙爜鐨勯偖浠躲傚瘑" -#~ "鐮佸彧鏈夋偍鍦ㄦ縺娲婚偖浠朵腑鐨勯摼鎺ユ墠浼氳婵娲汇" - -#~ msgid "Send new password" -#~ msgstr "鍙戦佹柊瀵嗙爜" diff --git a/log/cnprog.log b/log/cnprog.log deleted file mode 100644 index e69de29b..00000000 diff --git a/manage.py b/manage.py deleted file mode 100644 index b8c4be8e..00000000 --- a/manage.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) - -if __name__ == "__main__": - execute_manager(settings) diff --git a/middleware/__init__.py b/middleware/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/middleware/pagesize.py b/middleware/pagesize.py deleted file mode 100644 index bb6c7aa3..00000000 --- a/middleware/pagesize.py +++ /dev/null @@ -1,29 +0,0 @@ -# used in questions -QUESTIONS_PAGE_SIZE = 10 -class QuestionsPageSizeMiddleware(object): - def process_request(self, request): - # Set flag to False by default. If it is equal to True, then need to be saved. - pagesize_changed = False - # get pagesize from session, if failed then get default value - user_page_size = request.session.get("pagesize", QUESTIONS_PAGE_SIZE) - # set pagesize equal to logon user specified value in database - if request.user.is_authenticated() and request.user.questions_per_page > 0: - user_page_size = request.user.questions_per_page - - try: - # get new pagesize from UI selection - pagesize = int(request.GET.get('pagesize', user_page_size)) - if pagesize <> user_page_size: - pagesize_changed = True - - except ValueError: - pagesize = user_page_size - - # save this pagesize to user database - if pagesize_changed: - if request.user.is_authenticated(): - user = request.user - user.questions_per_page = pagesize - user.save() - # put pagesize into session - request.session["pagesize"] = pagesize \ No newline at end of file diff --git a/settings.py b/settings.py deleted file mode 100644 index 7ad8524a..00000000 --- a/settings.py +++ /dev/null @@ -1,146 +0,0 @@ -# Django settings for lanai project. -import os.path - -DEBUG = True -TEMPLATE_DEBUG = DEBUG - -SITE_SRC_ROOT = '/var/www/vhosts/cnprog' -#David Cramer debug toolbar -INTERNAL_IPS = ('127.0.0.1',) -DEBUG_TOOLBAR_PANELS = ( - 'debug_toolbar.panels.sql.SQLDebugPanel', - 'debug_toolbar.panels.headers.HeaderDebugPanel', - 'debug_toolbar.panels.cache.CacheDebugPanel', - 'debug_toolbar.panels.profiler.ProfilerDebugPanel', - 'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', - 'debug_toolbar.panels.templates.TemplatesDebugPanel', - # If you are using the profiler panel you don't need the timer - # 'debug_toolbar.panels.timer.TimerDebugPanel', -) - -DEBUG_TOOLBAR_CONFIG = { - "INTERCEPT_REDIRECTS":False -} - -#for logging -import logging -LOG_FILENAME = '/var/www/vhosts/cnprog/log/cnprog.log' -logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG,) - -#for OpenID auth -ugettext = lambda s: s -LOGIN_URL = '/%s%s' % (ugettext('account/'), ugettext('signin/')) - -#system will send admins email about error stacktrace if DEBUG=False -ADMINS = ( - ('you', 'you@where.com'), -) - -MANAGERS = ADMINS - -DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -#DATABASE_NAME = 'cnprog' # Or path to database file if using sqlite3. -#DATABASE_USER = 'root' # Not used with sqlite3. -#DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. - -DATABASE_NAME = 'dbname' # Or path to database file if using sqlite3. -DATABASE_USER = 'dbuser' # Not used with sqlite3. -DATABASE_PASSWORD = 'dbpass' # Not used with sqlite3. - -SERVER_EMAIL = 'server@where.com' -DEFAULT_FROM_EMAIL = 'from@where.com' -EMAIL_HOST_USER = '' -EMAIL_HOST_PASSWORD = '' -EMAIL_SUBJECT_PREFIX = '[cnprog.com]' -EMAIL_HOST='smtp.gmail.com' -EMAIL_PORT='587' -EMAIL_USE_TLS=True - - - - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# If running in a Windows environment this must be set to the same as your -# system time zone. -TIME_ZONE = 'America/Chicago' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -#LANGUAGE_CODE = 'en' -LANGUAGE_CODE = 'zh-cn' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '/var/www/vhosts/cnprog/templates/upfiles/' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = 'http://where.com/upfiles/' - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/admin/media/' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = '$oo^&_m&qwbib=ffljk_4m_n*zn-d=g#s0he5fx9xonnym#8p6yigm' - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', -# 'django.template.loaders.eggs.load_template_source', -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.gzip.GZipMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.locale.LocaleMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.middleware.transaction.TransactionMiddleware', - 'debug_toolbar.middleware.DebugToolbarMiddleware', -) - -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.core.context_processors.request', - 'django.core.context_processors.auth', -) - -ROOT_URLCONF = 'urls' - -TEMPLATE_DIRS = ( - os.path.join(os.path.dirname(__file__), 'templates').replace('\\','/'), -) - -FILE_UPLOAD_TEMP_DIR = os.path.join(os.path.dirname(__file__), 'tmp').replace('\\','/') -FILE_UPLOAD_HANDLERS = ("django.core.files.uploadhandler.MemoryFileUploadHandler", - "django.core.files.uploadhandler.TemporaryFileUploadHandler",) -DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' -# for user upload -ALLOW_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.tiff') -# unit byte -ALLOW_MAX_FILE_SIZE = 1024 * 1024 - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.admin', - 'django.contrib.humanize', - 'forum', - 'django_authopenid', - 'debug_toolbar' , -) diff --git a/settings_local.py.dist b/settings_local.py.dist deleted file mode 100644 index 2c8f939d..00000000 --- a/settings_local.py.dist +++ /dev/null @@ -1,25 +0,0 @@ -SITE_SRC_ROOT = '/Users/sailing/Development/cnprog_beta2' - -#for logging -import logging -LOG_FILENAME = '/Users/sailing/Development/cnprog_beta2/django.lanai.log' -logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG,) - - -#Database configuration -DATABASE_ENGINE = 'mysql' -DATABASE_HOST = '' -DATABASE_PORT = '' -DATABASE_NAME = 'cnprog' # Or path to database file if using sqlite3. -DATABASE_USER = 'root' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. - - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = '/Users/sailing/Development/cnprog_beta2/templates/upfiles/' - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" -MEDIA_URL = 'http://127.0.0.1:8000/upfiles/' diff --git a/sql_scripts/cnprog.xml b/sql_scripts/cnprog.xml deleted file mode 100644 index 95f9b362..00000000 --- a/sql_scripts/cnprog.xml +++ /dev/null @@ -1,1498 +0,0 @@ - - - - - -/Users/sailing/Development/cnprog_beta2/sql_scripts - - -ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=latin1 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - -content_type_id - - -user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -author_id - - -deleted_by_id - - -last_edited_by_id - - -locked_by_id - - -question_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - -answer_id - - -author_id - - - - -ENGINE=InnoDB DEFAULT CHARSET=utf8 - - -
- - -
- - -name - - - - -ENGINE=InnoDB DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - - - - - - - - - -group_id, permission_id - - -permission_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - - - - -user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - - - - - - -content_type_id - - -content_type_id, codename - - - - -ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -username - - - - -ENGINE=InnoDB DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - - - - - - - - - -group_id - - -user_id, group_id - - - - -ENGINE=InnoDB DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - - - - - - - - - -permission_id - - -user_id, permission_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -badge_id - - -user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -slug - - -name, type - - - - - - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - -short_name - - -user_id - - - - - - - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -user_id - - -book_id - - - - - - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -user_id - - -book_id - - - - - - - -
- - -
- - -
- - - - - - - - - - - - -book_id - - -question_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -content_type_id - - -user_id - - -content_type_id, object_id, user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -content_type_id - - -user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - -ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - - - -ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - - - - -user_id - - - - -ENGINE=InnoDB DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - - - - - - -user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -app_label, model - - - - -ENGINE=InnoDB DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - -ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - -ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - - - - - - - - - - - -question_id - - -user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -content_type_id, object_id, user_id - - -content_type_id - - -user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -author_id - - -closed_by_id - - -deleted_by_id - - -last_activity_by_id - - -last_edited_by_id - - -locked_by_id - - - - -ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -author_id - - -question_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - - - - - - - - - -question_id, tag_id - - -tag_id - - - - -ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 - - -
- - -
- - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -question_id - - -user_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - - - - - - -name - - -created_by_id - - - - -ENGINE=InnoDB DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - - - - - - - - - -user_id - - -badge_id - - - - -ENGINE=InnoDB DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - - - - - - - - - - - -user_id - - -question_id - - - - -ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 - - -
- - -
- - -
- - -
- - -
- - -
- - - - - - - - - - - - -content_type_id, object_id, user_id - - -content_type_id - - -user_id - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -db.doc.option.mgr - - - - - - - - - - - - - diff --git a/sql_scripts/cnprog_new_install.sql b/sql_scripts/cnprog_new_install.sql deleted file mode 100644 index ac33a6ba..00000000 --- a/sql_scripts/cnprog_new_install.sql +++ /dev/null @@ -1,811 +0,0 @@ --- MySQL Administrator dump 1.4 --- --- ------------------------------------------------------ --- Server version 5.0.67 - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; - -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; - - --- --- Create schema cnprog --- - -CREATE DATABASE IF NOT EXISTS cnprog; -USE cnprog; - --- --- Definition of table `cnprog`.`answer` --- - -DROP TABLE IF EXISTS `cnprog`.`answer`; -CREATE TABLE `cnprog`.`answer` ( - `id` int(11) NOT NULL auto_increment, - `question_id` int(11) NOT NULL, - `author_id` int(11) NOT NULL, - `added_at` datetime NOT NULL, - `wiki` tinyint(1) NOT NULL, - `wikified_at` datetime default NULL, - `accepted` tinyint(1) NOT NULL, - `deleted` tinyint(1) NOT NULL, - `deleted_by_id` int(11) default NULL, - `locked` tinyint(1) NOT NULL, - `locked_by_id` int(11) default NULL, - `locked_at` datetime default NULL, - `score` int(11) NOT NULL, - `vote_up_count` int(11) NOT NULL, - `vote_down_count` int(11) NOT NULL, - `comment_count` int(10) unsigned NOT NULL, - `offensive_flag_count` smallint(6) NOT NULL, - `last_edited_at` datetime default NULL, - `last_edited_by_id` int(11) default NULL, - `html` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `answer_question_id` (`question_id`), - KEY `answer_author_id` (`author_id`), - KEY `answer_deleted_by_id` (`deleted_by_id`), - KEY `answer_locked_by_id` (`locked_by_id`), - KEY `answer_last_edited_by_id` (`last_edited_by_id`), - CONSTRAINT `author_id_refs_id_192b0170` FOREIGN KEY (`author_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `deleted_by_id_refs_id_192b0170` FOREIGN KEY (`deleted_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `last_edited_by_id_refs_id_192b0170` FOREIGN KEY (`last_edited_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `locked_by_id_refs_id_192b0170` FOREIGN KEY (`locked_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `question_id_refs_id_7d6550c9` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; - --- --- Definition of table `cnprog`.`auth_group` --- - -DROP TABLE IF EXISTS `cnprog`.`auth_group`; -CREATE TABLE `cnprog`.`auth_group` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(80) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`auth_group` --- - --- --- Definition of table `cnprog`.`auth_group_permissions` --- - -DROP TABLE IF EXISTS `cnprog`.`auth_group_permissions`; -CREATE TABLE `cnprog`.`auth_group_permissions` ( - `id` int(11) NOT NULL auto_increment, - `group_id` int(11) NOT NULL, - `permission_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `group_id` (`group_id`,`permission_id`), - KEY `permission_id_refs_id_5886d21f` (`permission_id`), - CONSTRAINT `group_id_refs_id_3cea63fe` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), - CONSTRAINT `permission_id_refs_id_5886d21f` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`auth_group_permissions` --- - --- --- Definition of table `cnprog`.`auth_message` --- - -DROP TABLE IF EXISTS `cnprog`.`auth_message`; -CREATE TABLE `cnprog`.`auth_message` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `message` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `auth_message_user_id` (`user_id`), - CONSTRAINT `user_id_refs_id_650f49a6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`auth_message` --- - --- --- Definition of table `cnprog`.`auth_permission` --- - -DROP TABLE IF EXISTS `cnprog`.`auth_permission`; -CREATE TABLE `cnprog`.`auth_permission` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(50) NOT NULL, - `content_type_id` int(11) NOT NULL, - `codename` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `content_type_id` (`content_type_id`,`codename`), - KEY `auth_permission_content_type_id` (`content_type_id`), - CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`auth_permission` --- -INSERT INTO `cnprog`.`auth_permission` VALUES (1,'Can add permission',1,'add_permission'), - (2,'Can change permission',1,'change_permission'), - (3,'Can delete permission',1,'delete_permission'), - (4,'Can add group',2,'add_group'), - (5,'Can change group',2,'change_group'), - (6,'Can delete group',2,'delete_group'), - (7,'Can add user',3,'add_user'), - (8,'Can change user',3,'change_user'), - (9,'Can delete user',3,'delete_user'), - (10,'Can add message',4,'add_message'), - (11,'Can change message',4,'change_message'), - (12,'Can delete message',4,'delete_message'), - (13,'Can add content type',5,'add_contenttype'), - (14,'Can change content type',5,'change_contenttype'), - (15,'Can delete content type',5,'delete_contenttype'), - (16,'Can add session',6,'add_session'), - (17,'Can change session',6,'change_session'), - (18,'Can delete session',6,'delete_session'), - (19,'Can add site',7,'add_site'), - (20,'Can change site',7,'change_site'), - (21,'Can delete site',7,'delete_site'), - (25,'Can add answer',9,'add_answer'), - (26,'Can change answer',9,'change_answer'), - (27,'Can delete answer',9,'delete_answer'), - (28,'Can add comment',10,'add_comment'), - (29,'Can change comment',10,'change_comment'), - (30,'Can delete comment',10,'delete_comment'), - (31,'Can add tag',11,'add_tag'), - (32,'Can change tag',11,'change_tag'), - (33,'Can delete tag',11,'delete_tag'), - (37,'Can add nonce',13,'add_nonce'), - (38,'Can change nonce',13,'change_nonce'), - (39,'Can delete nonce',13,'delete_nonce'), - (40,'Can add association',14,'add_association'), - (41,'Can change association',14,'change_association'), - (42,'Can delete association',14,'delete_association'), - (43,'Can add nonce',15,'add_nonce'), - (44,'Can change nonce',15,'change_nonce'), - (45,'Can delete nonce',15,'delete_nonce'), - (46,'Can add association',16,'add_association'), - (47,'Can change association',16,'change_association'), - (48,'Can delete association',16,'delete_association'), - (49,'Can add user association',17,'add_userassociation'), - (50,'Can change user association',17,'change_userassociation'), - (51,'Can delete user association',17,'delete_userassociation'), - (52,'Can add user password queue',18,'add_userpasswordqueue'), - (53,'Can change user password queue',18,'change_userpasswordqueue'), - (54,'Can delete user password queue',18,'delete_userpasswordqueue'), - (55,'Can add log entry',19,'add_logentry'), - (56,'Can change log entry',19,'change_logentry'), - (57,'Can delete log entry',19,'delete_logentry'), - (58,'Can add question',20,'add_question'), - (59,'Can change question',20,'change_question'), - (60,'Can delete question',20,'delete_question'), - (61,'Can add vote',21,'add_vote'), - (62,'Can change vote',21,'change_vote'), - (63,'Can delete vote',21,'delete_vote'), - (64,'Can add flagged item',22,'add_flaggeditem'), - (65,'Can change flagged item',22,'change_flaggeditem'), - (66,'Can delete flagged item',22,'delete_flaggeditem'), - (67,'Can add favorite question',23,'add_favoritequestion'), - (68,'Can change favorite question',23,'change_favoritequestion'), - (69,'Can delete favorite question',23,'delete_favoritequestion'), - (70,'Can add badge',24,'add_badge'), - (71,'Can change badge',24,'change_badge'), - (72,'Can delete badge',24,'delete_badge'), - (73,'Can add award',25,'add_award'), - (74,'Can change award',25,'change_award'), - (75,'Can delete award',25,'delete_award'); - --- --- Definition of table `cnprog`.`auth_user` --- - -DROP TABLE IF EXISTS `cnprog`.`auth_user`; -CREATE TABLE `cnprog`.`auth_user` ( - `id` int(11) NOT NULL auto_increment, - `username` varchar(30) NOT NULL, - `first_name` varchar(30) NOT NULL, - `last_name` varchar(30) NOT NULL, - `email` varchar(75) NOT NULL, - `password` varchar(128) NOT NULL, - `is_staff` tinyint(1) NOT NULL, - `is_active` tinyint(1) NOT NULL, - `is_superuser` tinyint(1) NOT NULL, - `last_login` datetime NOT NULL, - `date_joined` datetime NOT NULL, - `gold` smallint(6) NOT NULL default '0', - `silver` smallint(5) unsigned NOT NULL default '0', - `bronze` smallint(5) unsigned NOT NULL default '0', - `reputation` int(10) unsigned default '1', - `gravatar` varchar(128) default NULL, - `questions_per_page` smallint(5) unsigned default '10', - `last_seen` datetime default NULL, - `real_name` varchar(100) default NULL, - `website` varchar(200) default NULL, - `location` varchar(100) default NULL, - `date_of_birth` datetime default NULL, - `about` text, - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`auth_user` --- -INSERT INTO `cnprog`.`auth_user` VALUES (2,'chagel','','','chagel@gmail.com','sha1$6a2fb$0d2ffe90bcba542fc962f57967a88e507799cc74',1,1,1,'2008-12-16 15:35:17','2008-12-11 20:12:53',0,0,0,1,'8c1efc4f4618aa68b18c88f2bcaa5564',10,NULL,NULL,NULL,NULL,NULL,NULL), - (3,'mike','','','ichagel@yahoo.com','sha1$f7ef5$1015ae6b2c8a2774a028419d3c57e13145b83284',0,1,0,'2008-12-15 12:56:23','2008-12-15 12:56:23',0,0,0,1,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL), - (4,'sailingcai','','','sailingcai@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-23 06:14:45','2008-12-20 15:19:21',1,2,3,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','',NULL,''), - (5,'sailingcai1','','','1@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21',NULL,NULL,NULL,NULL,NULL), - (6,'sailing2','','','2@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (7,'sailing3','','','3@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (8,'sailing4','','','4@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (9,'sailing5','','','5@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (10,'sailing6','','','6@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (11,'sailing7','','','7@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (12,'sailing8','','','8@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (13,'sailing9','','','9@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (14,'sailing10','','','10@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (15,'sailing11','','','11@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (16,'sailing12','','','12@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (17,'sailing13','','','13@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (18,'sailing14','','','14@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (19,'sailing15','','','15@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (20,'sailing16','','','16@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (21,'sailing17','','','17@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (22,'sailing18','','','18@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (23,'sailing19','','','19@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (24,'sailing20','','','20@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (25,'sailing21','','','21@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (26,'sailing22','','','22@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (27,'sailing23','','','23@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (28,'sailing24','','','24@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (29,'sailing25','','','25@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (30,'sailing26','','','26@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (31,'sailing27','','','27@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (32,'sailing28','','','28@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (33,'sailing29','','','29@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (34,'sailing30','','','30@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (35,'sailing31','','','31@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (36,'sailing32','','','32@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (37,'sailing33','','','33@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (38,'sailing34','','','34@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (39,'sailing35','','','35@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (40,'sailing36','','','36@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (41,'sailing37','','','37@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (42,'sailing38','','','38@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (43,'sailing39','','','39@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (44,'sailing40','','','40@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (45,'sailing41','','','41@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (46,'sailing42','','','42@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (47,'sailing43','','','43@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (48,'sailing44','','','44@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (49,'sailing45','','','45@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (50,'sailing46','','','46@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (51,'sailing47','','','47@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (52,'sailing48','','','48@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (53,'sailing49','','','49@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (54,'sailing50','','','50@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (55,'sailing51','','','51@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (56,'sailing52','','','52@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (57,'sailing53','','','53@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (58,'sailing54','','','54@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (59,'sailing55','','','55@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (60,'sailing56','','','56@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (61,'sailing57','','','57@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (62,'sailing58','','','58@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (63,'sailing59','','','59@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (64,'sailing60','','','60@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (65,'sailing61','','','61@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (66,'sailing62','','','62@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (67,'sailing63','','','63@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (68,'sailing64','','','64@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (69,'sailing65','','','65@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (70,'sailing66','','','66@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (71,'sailing67','','','67@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (72,'sailing68','','','68@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (73,'sailing69','','','69@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (74,'sailing70','','','70@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (75,'sailing71','','','71@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (76,'sailing72','','','72@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (77,'sailing73','','','73@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (78,'sailing74','','','74@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (79,'sailing75','','','75@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (80,'sailing76','','','76@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (81,'sailing77','','','77@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (82,'sailing78','','','78@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (83,'sailing79','','','79@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (84,'sailing80','','','80@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (85,'sailing81','','','81@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (86,'sailing82','','','82@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (87,'sailing83','','','83@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (88,'sailing84','','','84@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (89,'sailing85','','','85@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (90,'sailing86','','','86@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (91,'sailing87','','','87@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (92,'sailing88','','','88@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (93,'sailing89','','','89@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (94,'sailing90','','','90@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (95,'sailing91','','','91@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (96,'sailing92','','','92@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (97,'sailing93','','','93@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (98,'sailing94','','','94@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (99,'sailing95','','','95@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (100,'sailing96','','','96@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (101,'sailing97','','','97@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (102,'sailing98','','','98@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), - (103,'sailing99','','','99@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''); - --- --- Definition of table `cnprog`.`auth_user_groups` --- - -DROP TABLE IF EXISTS `cnprog`.`auth_user_groups`; -CREATE TABLE `cnprog`.`auth_user_groups` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `group_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`,`group_id`), - KEY `group_id_refs_id_f116770` (`group_id`), - CONSTRAINT `group_id_refs_id_f116770` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), - CONSTRAINT `user_id_refs_id_7ceef80f` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`auth_user_groups` --- - --- --- Definition of table `cnprog`.`auth_user_user_permissions` --- - -DROP TABLE IF EXISTS `cnprog`.`auth_user_user_permissions`; -CREATE TABLE `cnprog`.`auth_user_user_permissions` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `permission_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`,`permission_id`), - KEY `permission_id_refs_id_67e79cb` (`permission_id`), - CONSTRAINT `permission_id_refs_id_67e79cb` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`), - CONSTRAINT `user_id_refs_id_dfbab7d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`auth_user_user_permissions` --- - --- --- Definition of table `cnprog`.`award` --- - -DROP TABLE IF EXISTS `cnprog`.`award`; -CREATE TABLE `cnprog`.`award` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `badge_id` int(11) NOT NULL, - `awarded_at` datetime NOT NULL, - `notified` tinyint(1) NOT NULL, - PRIMARY KEY (`id`), - KEY `award_user_id` (`user_id`), - KEY `award_badge_id` (`badge_id`), - CONSTRAINT `badge_id_refs_id_651af0e1` FOREIGN KEY (`badge_id`) REFERENCES `badge` (`id`), - CONSTRAINT `user_id_refs_id_2d83e9b6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`award` --- - --- --- Definition of table `cnprog`.`badge` --- - -DROP TABLE IF EXISTS `cnprog`.`badge`; -CREATE TABLE `cnprog`.`badge` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(50) NOT NULL, - `type` smallint(6) NOT NULL, - `slug` varchar(50) NOT NULL, - `description` varchar(300) NOT NULL, - `multiple` tinyint(1) NOT NULL, - `awarded_count` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`,`type`), - KEY `badge_slug` (`slug`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`badge` --- - --- --- Definition of table `cnprog`.`comment` --- - -DROP TABLE IF EXISTS `cnprog`.`comment`; -CREATE TABLE `cnprog`.`comment` ( - `id` int(11) NOT NULL auto_increment, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `user_id` int(11) NOT NULL, - `comment` varchar(300) NOT NULL, - `added_at` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), - KEY `comment_content_type_id` (`content_type_id`), - KEY `comment_user_id` (`user_id`), - CONSTRAINT `content_type_id_refs_id_13a5866c` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_6be725e8` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`comment` --- - --- --- Definition of table `cnprog`.`django_admin_log` --- - -DROP TABLE IF EXISTS `cnprog`.`django_admin_log`; -CREATE TABLE `cnprog`.`django_admin_log` ( - `id` int(11) NOT NULL auto_increment, - `action_time` datetime NOT NULL, - `user_id` int(11) NOT NULL, - `content_type_id` int(11) default NULL, - `object_id` longtext, - `object_repr` varchar(200) NOT NULL, - `action_flag` smallint(5) unsigned NOT NULL, - `change_message` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `django_admin_log_user_id` (`user_id`), - KEY `django_admin_log_content_type_id` (`content_type_id`), - CONSTRAINT `content_type_id_refs_id_288599e6` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_c8665aa` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`django_admin_log` --- -INSERT INTO `cnprog`.`django_admin_log` VALUES (1,'2008-12-18 23:41:41',2,7,'1','cnprog.com',2,'宸蹭慨鏀 domain 鍜 name 銆'); - --- --- Definition of table `cnprog`.`django_authopenid_association` --- - -DROP TABLE IF EXISTS `cnprog`.`django_authopenid_association`; -CREATE TABLE `cnprog`.`django_authopenid_association` ( - `id` int(11) NOT NULL auto_increment, - `server_url` longtext NOT NULL, - `handle` varchar(255) NOT NULL, - `secret` longtext NOT NULL, - `issued` int(11) NOT NULL, - `lifetime` int(11) NOT NULL, - `assoc_type` longtext NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`django_authopenid_association` --- -INSERT INTO `cnprog`.`django_authopenid_association` VALUES (2,'https://www.google.com/accounts/o8/ud','AOQobUfcCH4sgjsBGGscrzxIa5UM4clofAB6nixx8Qq_NWco4ynn_Kc4','u5cva43abzdwF8CJOFZfkzfk7x8=\n',1229022261,1229022261,'HMAC-SHA1'), - (3,'https://api.screenname.aol.com/auth/openidServer','diAyLjAgayAwIGJhT2VvYkdDZ21RSHJ4QldzQnhTdjIxV3BVbz0%3D-j5HRXRB1VbPyg48jGKE1Q70dfv76lGHEPwd9071%2FJ7f6SSw5YhakrwWpsVXtr34T6iHwPDdo6RU%3D','EmQL3+5oR6mFKIaeBNy6hXyUJ/w=\n',1229282202,1229282202,'HMAC-SHA1'), - (4,'https://open.login.yahooapis.com/openid/op/auth','JcBeY.uWXu2YjzbuCQiqFzAb0MIc7ATeKiPO4eAp3vluPMqZp_NCxepvMLGrJjxxDKTaNnr06wepMos8ap6SQYZiTi51tZ05lMWnpZAiOA1hsq_WMlEL7G9YE66GEA9A','QXiuN6B7E8nP5QhyHI3IB26t4SA=\n',1229282256,1229282256,'HMAC-SHA1'), - (5,'http://openid.claimid.com/server','{HMAC-SHA1}{494575fd}{uLEbxQ==}','GvPbkgMHh0QVPH7mStCGuWb2AKY=\n',1229288957,1229288957,'HMAC-SHA1'), - (6,'http://www.blogger.com/openid-server.g','oida-1229424484019-158830626','8gaU4aKnIFCLKIkHdxZQp7ZGNck=\n',1229424478,1229424478,'HMAC-SHA1'); - --- --- Definition of table `cnprog`.`django_authopenid_nonce` --- - -DROP TABLE IF EXISTS `cnprog`.`django_authopenid_nonce`; -CREATE TABLE `cnprog`.`django_authopenid_nonce` ( - `id` int(11) NOT NULL auto_increment, - `server_url` varchar(255) NOT NULL, - `timestamp` int(11) NOT NULL, - `salt` varchar(40) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; - --- --- Definition of table `cnprog`.`django_authopenid_userassociation` --- - -DROP TABLE IF EXISTS `cnprog`.`django_authopenid_userassociation`; -CREATE TABLE `cnprog`.`django_authopenid_userassociation` ( - `id` int(11) NOT NULL auto_increment, - `openid_url` varchar(255) NOT NULL, - `user_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - CONSTRAINT `user_id_refs_id_163d208d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`django_authopenid_userassociation` --- -INSERT INTO `cnprog`.`django_authopenid_userassociation` VALUES (2,'https://www.google.com/accounts/o8/id?id=AItOawl7CVVHl4DWtteqj4dd_A23zKRwPZgOOjw',2), - (3,'https://me.yahoo.com/a/f8f2zXF91okYL4iN2Zh4P542a5s-#f4af2',3), - (4,'https://me.yahoo.com/sailingcai#6fa4e',4); - --- --- Definition of table `cnprog`.`django_authopenid_userpasswordqueue` --- - -DROP TABLE IF EXISTS `cnprog`.`django_authopenid_userpasswordqueue`; -CREATE TABLE `cnprog`.`django_authopenid_userpasswordqueue` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `new_password` varchar(30) NOT NULL, - `confirm_key` varchar(40) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - CONSTRAINT `user_id_refs_id_76bcaaa4` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`django_authopenid_userpasswordqueue` --- - --- --- Definition of table `cnprog`.`django_content_type` --- - -DROP TABLE IF EXISTS `cnprog`.`django_content_type`; -CREATE TABLE `cnprog`.`django_content_type` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(100) NOT NULL, - `app_label` varchar(100) NOT NULL, - `model` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `app_label` (`app_label`,`model`) -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`django_content_type` --- -INSERT INTO `cnprog`.`django_content_type` VALUES (1,'permission','auth','permission'), - (2,'group','auth','group'), - (3,'user','auth','user'), - (4,'message','auth','message'), - (5,'content type','contenttypes','contenttype'), - (6,'session','sessions','session'), - (7,'site','sites','site'), - (9,'answer','forum','answer'), - (10,'comment','forum','comment'), - (11,'tag','forum','tag'), - (13,'nonce','django_openidconsumer','nonce'), - (14,'association','django_openidconsumer','association'), - (15,'nonce','django_authopenid','nonce'), - (16,'association','django_authopenid','association'), - (17,'user association','django_authopenid','userassociation'), - (18,'user password queue','django_authopenid','userpasswordqueue'), - (19,'log entry','admin','logentry'), - (20,'question','forum','question'), - (21,'vote','forum','vote'), - (22,'flagged item','forum','flaggeditem'), - (23,'favorite question','forum','favoritequestion'), - (24,'badge','forum','badge'), - (25,'award','forum','award'); - --- --- Definition of table `cnprog`.`django_session` --- - -DROP TABLE IF EXISTS `cnprog`.`django_session`; -CREATE TABLE `cnprog`.`django_session` ( - `session_key` varchar(40) NOT NULL, - `session_data` longtext NOT NULL, - `expire_date` datetime NOT NULL, - PRIMARY KEY (`session_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Definition of table `cnprog`.`django_site` --- - -DROP TABLE IF EXISTS `cnprog`.`django_site`; -CREATE TABLE `cnprog`.`django_site` ( - `id` int(11) NOT NULL auto_increment, - `domain` varchar(100) NOT NULL, - `name` varchar(50) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`django_site` --- -INSERT INTO `cnprog`.`django_site` VALUES (1,'cnprog.com','CNProg.com'); - --- --- Definition of table `cnprog`.`favorite_question` --- - -DROP TABLE IF EXISTS `cnprog`.`favorite_question`; -CREATE TABLE `cnprog`.`favorite_question` ( - `id` int(11) NOT NULL auto_increment, - `question_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `added_at` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `favorite_question_question_id` (`question_id`), - KEY `favorite_question_user_id` (`user_id`), - CONSTRAINT `question_id_refs_id_1ebe1cc3` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), - CONSTRAINT `user_id_refs_id_52853822` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`favorite_question` --- - --- --- Definition of table `cnprog`.`flagged_item` --- - -DROP TABLE IF EXISTS `cnprog`.`flagged_item`; -CREATE TABLE `cnprog`.`flagged_item` ( - `id` int(11) NOT NULL auto_increment, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `user_id` int(11) NOT NULL, - `flagged_at` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), - KEY `flagged_item_content_type_id` (`content_type_id`), - KEY `flagged_item_user_id` (`user_id`), - CONSTRAINT `content_type_id_refs_id_76e44d74` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_35e3c608` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`flagged_item` --- - --- --- Definition of table `cnprog`.`question` --- - -DROP TABLE IF EXISTS `cnprog`.`question`; -CREATE TABLE `cnprog`.`question` ( - `id` int(11) NOT NULL auto_increment, - `title` varchar(300) NOT NULL, - `author_id` int(11) NOT NULL, - `added_at` datetime NOT NULL, - `wiki` tinyint(1) NOT NULL, - `wikified_at` datetime default NULL, - `answer_accepted` tinyint(1) NOT NULL, - `closed` tinyint(1) NOT NULL, - `closed_by_id` int(11) default NULL, - `closed_at` datetime default NULL, - `close_reason` smallint(6) default NULL, - `deleted` tinyint(1) NOT NULL, - `deleted_at` datetime default NULL, - `deleted_by_id` int(11) default NULL, - `locked` tinyint(1) NOT NULL, - `locked_by_id` int(11) default NULL, - `locked_at` datetime default NULL, - `vote_up_count` int(11) NOT NULL, - `vote_down_count` int(11) NOT NULL, - `score` int(11) NOT NULL, - `answer_count` int(10) unsigned NOT NULL, - `comment_count` int(10) unsigned NOT NULL, - `view_count` int(10) unsigned NOT NULL, - `offensive_flag_count` smallint(6) NOT NULL, - `favourite_count` int(10) unsigned NOT NULL, - `last_edited_at` datetime default NULL, - `last_edited_by_id` int(11) default NULL, - `last_activity_at` datetime NOT NULL, - `last_activity_by_id` int(11) NOT NULL, - `tagnames` varchar(125) NOT NULL, - `summary` varchar(180) NOT NULL, - `html` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `question_author_id` (`author_id`), - KEY `question_closed_by_id` (`closed_by_id`), - KEY `question_deleted_by_id` (`deleted_by_id`), - KEY `question_locked_by_id` (`locked_by_id`), - KEY `question_last_edited_by_id` (`last_edited_by_id`), - KEY `question_last_activity_by_id` (`last_activity_by_id`), - CONSTRAINT `author_id_refs_id_56e9d00c` FOREIGN KEY (`author_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `closed_by_id_refs_id_56e9d00c` FOREIGN KEY (`closed_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `deleted_by_id_refs_id_56e9d00c` FOREIGN KEY (`deleted_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `last_activity_by_id_refs_id_56e9d00c` FOREIGN KEY (`last_activity_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `last_edited_by_id_refs_id_56e9d00c` FOREIGN KEY (`last_edited_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `locked_by_id_refs_id_56e9d00c` FOREIGN KEY (`locked_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; - --- --- Definition of table `cnprog`.`question_tags` --- - -DROP TABLE IF EXISTS `cnprog`.`question_tags`; -CREATE TABLE `cnprog`.`question_tags` ( - `id` int(11) NOT NULL auto_increment, - `question_id` int(11) NOT NULL, - `tag_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `question_id` (`question_id`,`tag_id`), - KEY `tag_id_refs_id_43fcb953` (`tag_id`), - CONSTRAINT `question_id_refs_id_266147c6` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), - CONSTRAINT `tag_id_refs_id_43fcb953` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8; - --- --- Definition of table `cnprog`.`tag` --- - -DROP TABLE IF EXISTS `cnprog`.`tag`; -CREATE TABLE `cnprog`.`tag` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(255) NOT NULL, - `created_by_id` int(11) NOT NULL, - `used_count` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`), - KEY `tag_created_by_id` (`created_by_id`), - CONSTRAINT `created_by_id_refs_id_47205d6d` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; - --- --- Definition of table `cnprog`.`user_badge` --- - -DROP TABLE IF EXISTS `cnprog`.`user_badge`; -CREATE TABLE `cnprog`.`user_badge` ( - `id` int(10) unsigned NOT NULL auto_increment, - `user_id` int(10) unsigned NOT NULL, - `badge_id` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Definition of table `cnprog`.`user_favorite_questions` --- - -DROP TABLE IF EXISTS `cnprog`.`user_favorite_questions`; -CREATE TABLE `cnprog`.`user_favorite_questions` ( - `id` int(10) unsigned NOT NULL auto_increment, - `user_id` int(10) unsigned NOT NULL, - `question_id` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`user_favorite_questions` --- - -DROP TABLE IF EXISTS `cnprog`.`vote`; -CREATE TABLE `cnprog`.`vote` ( - `id` int(11) NOT NULL auto_increment, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `user_id` int(11) NOT NULL, - `vote` smallint(6) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), - KEY `vote_content_type_id` (`content_type_id`), - KEY `vote_user_id` (`user_id`), - CONSTRAINT `content_type_id_refs_id_50124414` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_760a4df0` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- --- Dumping data for table `cnprog`.`vote` --- - - - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/sql_scripts/cnprog_new_install_2009_02_28.sql b/sql_scripts/cnprog_new_install_2009_02_28.sql deleted file mode 100644 index 80b9fced..00000000 --- a/sql_scripts/cnprog_new_install_2009_02_28.sql +++ /dev/null @@ -1,456 +0,0 @@ -SET FOREIGN_KEY_CHECKS = 0; - -CREATE TABLE `activity` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `activity_type` smallint(6) NOT NULL, - `active_at` datetime NOT NULL, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `is_auditted` tinyint(1) default '0', - PRIMARY KEY (`id`), - KEY `activity_user_id` (`user_id`), - KEY `activity_content_type_id` (`content_type_id`) -) ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=utf8; - - -CREATE TABLE `answer` ( - `id` int(11) NOT NULL auto_increment, - `question_id` int(11) NOT NULL, - `author_id` int(11) NOT NULL, - `added_at` datetime NOT NULL, - `wiki` tinyint(1) NOT NULL, - `wikified_at` datetime default NULL, - `accepted` tinyint(1) NOT NULL, - `deleted` tinyint(1) NOT NULL, - `deleted_by_id` int(11) default NULL, - `locked` tinyint(1) NOT NULL, - `locked_by_id` int(11) default NULL, - `locked_at` datetime default NULL, - `score` int(11) NOT NULL, - `comment_count` int(10) unsigned NOT NULL, - `offensive_flag_count` smallint(6) NOT NULL, - `last_edited_at` datetime default NULL, - `last_edited_by_id` int(11) default NULL, - `html` longtext NOT NULL, - `vote_up_count` int(11) NOT NULL, - `vote_down_count` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `answer_question_id` (`question_id`), - KEY `answer_author_id` (`author_id`), - KEY `answer_deleted_by_id` (`deleted_by_id`), - KEY `answer_locked_by_id` (`locked_by_id`), - KEY `answer_last_edited_by_id` (`last_edited_by_id`), - CONSTRAINT `author_id_refs_id_192b0170` FOREIGN KEY (`author_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `deleted_by_id_refs_id_192b0170` FOREIGN KEY (`deleted_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `last_edited_by_id_refs_id_192b0170` FOREIGN KEY (`last_edited_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `locked_by_id_refs_id_192b0170` FOREIGN KEY (`locked_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `question_id_refs_id_7d6550c9` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; - - -CREATE TABLE `answer_revision` ( - `id` int(11) NOT NULL auto_increment, - `answer_id` int(11) NOT NULL, - `revision` int(10) unsigned NOT NULL, - `author_id` int(11) NOT NULL, - `revised_at` datetime NOT NULL, - `summary` varchar(300) collate utf8_unicode_ci NOT NULL, - `text` longtext collate utf8_unicode_ci NOT NULL, - PRIMARY KEY (`id`), - KEY `answer_revision_answer_id` (`answer_id`), - KEY `answer_revision_author_id` (`author_id`) -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; - - -CREATE TABLE `auth_group` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(80) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `auth_group_permissions` ( - `id` int(11) NOT NULL auto_increment, - `group_id` int(11) NOT NULL, - `permission_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `group_id` (`group_id`,`permission_id`), - KEY `permission_id_refs_id_5886d21f` (`permission_id`), - CONSTRAINT `group_id_refs_id_3cea63fe` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), - CONSTRAINT `permission_id_refs_id_5886d21f` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `auth_message` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `message` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `auth_message_user_id` (`user_id`), - CONSTRAINT `user_id_refs_id_650f49a6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; - - -CREATE TABLE `auth_permission` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(50) NOT NULL, - `content_type_id` int(11) NOT NULL, - `codename` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `content_type_id` (`content_type_id`,`codename`), - KEY `auth_permission_content_type_id` (`content_type_id`), - CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8; - - -CREATE TABLE `auth_user` ( - `id` int(11) NOT NULL auto_increment, - `username` varchar(30) NOT NULL, - `first_name` varchar(30) NOT NULL, - `last_name` varchar(30) NOT NULL, - `email` varchar(75) NOT NULL, - `password` varchar(128) NOT NULL, - `is_staff` tinyint(1) NOT NULL, - `is_active` tinyint(1) NOT NULL, - `is_superuser` tinyint(1) NOT NULL, - `last_login` datetime NOT NULL, - `date_joined` datetime NOT NULL, - `gold` smallint(6) NOT NULL default '0', - `silver` smallint(5) unsigned NOT NULL default '0', - `bronze` smallint(5) unsigned NOT NULL default '0', - `reputation` int(10) unsigned default '1', - `gravatar` varchar(128) default NULL, - `questions_per_page` smallint(5) unsigned default '10', - `last_seen` datetime default NULL, - `real_name` varchar(100) default NULL, - `website` varchar(200) default NULL, - `location` varchar(100) default NULL, - `date_of_birth` datetime default NULL, - `about` text, - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; - - -CREATE TABLE `auth_user_groups` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `group_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`,`group_id`), - KEY `group_id_refs_id_f116770` (`group_id`), - CONSTRAINT `group_id_refs_id_f116770` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), - CONSTRAINT `user_id_refs_id_7ceef80f` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `auth_user_user_permissions` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `permission_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`,`permission_id`), - KEY `permission_id_refs_id_67e79cb` (`permission_id`), - CONSTRAINT `permission_id_refs_id_67e79cb` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`), - CONSTRAINT `user_id_refs_id_dfbab7d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `award` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `badge_id` int(11) NOT NULL, - `awarded_at` datetime NOT NULL, - `notified` tinyint(1) NOT NULL, - `content_type_id` int(11) default NULL, - `object_id` int(10) default NULL, - PRIMARY KEY (`id`), - KEY `award_user_id` (`user_id`), - KEY `award_badge_id` (`badge_id`), - CONSTRAINT `badge_id_refs_id_651af0e1` FOREIGN KEY (`badge_id`) REFERENCES `badge` (`id`), - CONSTRAINT `user_id_refs_id_2d83e9b6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; - - -CREATE TABLE `badge` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(50) NOT NULL, - `type` smallint(6) NOT NULL, - `slug` varchar(50) NOT NULL, - `description` varchar(300) NOT NULL, - `multiple` tinyint(1) NOT NULL, - `awarded_count` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`,`type`), - KEY `badge_slug` (`slug`) -) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; - - -CREATE TABLE `comment` ( - `id` int(11) NOT NULL auto_increment, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `user_id` int(11) NOT NULL, - `comment` varchar(300) NOT NULL, - `added_at` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `comment_content_type_id` (`content_type_id`), - KEY `comment_user_id` (`user_id`), - KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), - CONSTRAINT `content_type_id_refs_id_13a5866c` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_6be725e8` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; - - -CREATE TABLE `django_admin_log` ( - `id` int(11) NOT NULL auto_increment, - `action_time` datetime NOT NULL, - `user_id` int(11) NOT NULL, - `content_type_id` int(11) default NULL, - `object_id` longtext, - `object_repr` varchar(200) NOT NULL, - `action_flag` smallint(5) unsigned NOT NULL, - `change_message` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `django_admin_log_user_id` (`user_id`), - KEY `django_admin_log_content_type_id` (`content_type_id`), - CONSTRAINT `content_type_id_refs_id_288599e6` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_c8665aa` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - - -CREATE TABLE `django_authopenid_association` ( - `id` int(11) NOT NULL auto_increment, - `server_url` longtext NOT NULL, - `handle` varchar(255) NOT NULL, - `secret` longtext NOT NULL, - `issued` int(11) NOT NULL, - `lifetime` int(11) NOT NULL, - `assoc_type` longtext NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; - - -CREATE TABLE `django_authopenid_nonce` ( - `id` int(11) NOT NULL auto_increment, - `server_url` varchar(255) NOT NULL, - `timestamp` int(11) NOT NULL, - `salt` varchar(40) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; - - -CREATE TABLE `django_authopenid_userassociation` ( - `id` int(11) NOT NULL auto_increment, - `openid_url` varchar(255) NOT NULL, - `user_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - CONSTRAINT `user_id_refs_id_163d208d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - - -CREATE TABLE `django_authopenid_userpasswordqueue` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `new_password` varchar(30) NOT NULL, - `confirm_key` varchar(40) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`), - CONSTRAINT `user_id_refs_id_76bcaaa4` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `django_content_type` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(100) NOT NULL, - `app_label` varchar(100) NOT NULL, - `model` varchar(100) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `app_label` (`app_label`,`model`) -) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; - - -CREATE TABLE `django_session` ( - `session_key` varchar(40) NOT NULL, - `session_data` longtext NOT NULL, - `expire_date` datetime NOT NULL, - PRIMARY KEY (`session_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `django_site` ( - `id` int(11) NOT NULL auto_increment, - `domain` varchar(100) NOT NULL, - `name` varchar(50) NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - - -CREATE TABLE `favorite_question` ( - `id` int(11) NOT NULL auto_increment, - `question_id` int(11) NOT NULL, - `user_id` int(11) NOT NULL, - `added_at` datetime NOT NULL, - PRIMARY KEY (`id`), - KEY `favorite_question_question_id` (`question_id`), - KEY `favorite_question_user_id` (`user_id`), - CONSTRAINT `question_id_refs_id_1ebe1cc3` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), - CONSTRAINT `user_id_refs_id_52853822` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - - -CREATE TABLE `flagged_item` ( - `id` int(11) NOT NULL auto_increment, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `user_id` int(11) NOT NULL, - `flagged_at` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), - KEY `flagged_item_content_type_id` (`content_type_id`), - KEY `flagged_item_user_id` (`user_id`), - CONSTRAINT `content_type_id_refs_id_76e44d74` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_35e3c608` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; - - -CREATE TABLE `question` ( - `id` int(11) NOT NULL auto_increment, - `title` varchar(300) NOT NULL, - `author_id` int(11) NOT NULL, - `added_at` datetime NOT NULL, - `wiki` tinyint(1) NOT NULL, - `wikified_at` datetime default NULL, - `answer_accepted` tinyint(1) NOT NULL, - `closed` tinyint(1) NOT NULL, - `closed_by_id` int(11) default NULL, - `closed_at` datetime default NULL, - `close_reason` smallint(6) default NULL, - `deleted` tinyint(1) NOT NULL, - `deleted_at` datetime default NULL, - `deleted_by_id` int(11) default NULL, - `locked` tinyint(1) NOT NULL, - `locked_by_id` int(11) default NULL, - `locked_at` datetime default NULL, - `score` int(11) NOT NULL, - `answer_count` int(10) unsigned NOT NULL, - `comment_count` int(10) unsigned NOT NULL, - `view_count` int(10) unsigned NOT NULL, - `offensive_flag_count` smallint(6) NOT NULL, - `favourite_count` int(10) unsigned NOT NULL, - `last_edited_at` datetime default NULL, - `last_edited_by_id` int(11) default NULL, - `last_activity_at` datetime NOT NULL, - `last_activity_by_id` int(11) NOT NULL, - `tagnames` varchar(125) NOT NULL, - `summary` varchar(180) NOT NULL, - `html` longtext NOT NULL, - `vote_up_count` int(11) NOT NULL, - `vote_down_count` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `question_author_id` (`author_id`), - KEY `question_closed_by_id` (`closed_by_id`), - KEY `question_deleted_by_id` (`deleted_by_id`), - KEY `question_locked_by_id` (`locked_by_id`), - KEY `question_last_edited_by_id` (`last_edited_by_id`), - KEY `question_last_activity_by_id` (`last_activity_by_id`), - CONSTRAINT `author_id_refs_id_56e9d00c` FOREIGN KEY (`author_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `closed_by_id_refs_id_56e9d00c` FOREIGN KEY (`closed_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `deleted_by_id_refs_id_56e9d00c` FOREIGN KEY (`deleted_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `last_activity_by_id_refs_id_56e9d00c` FOREIGN KEY (`last_activity_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `last_edited_by_id_refs_id_56e9d00c` FOREIGN KEY (`last_edited_by_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `locked_by_id_refs_id_56e9d00c` FOREIGN KEY (`locked_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; - - -CREATE TABLE `question_revision` ( - `id` int(11) NOT NULL auto_increment, - `question_id` int(11) NOT NULL, - `revision` int(10) unsigned NOT NULL, - `title` varchar(300) NOT NULL, - `author_id` int(11) NOT NULL, - `revised_at` datetime NOT NULL, - `tagnames` varchar(125) NOT NULL, - `summary` varchar(300) NOT NULL, - `text` longtext NOT NULL, - PRIMARY KEY (`id`), - KEY `question_revision_question_id` (`question_id`), - KEY `question_revision_author_id` (`author_id`) -) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; - - -CREATE TABLE `question_tags` ( - `id` int(11) NOT NULL auto_increment, - `question_id` int(11) NOT NULL, - `tag_id` int(11) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `question_id` (`question_id`,`tag_id`), - KEY `tag_id_refs_id_43fcb953` (`tag_id`), - CONSTRAINT `question_id_refs_id_266147c6` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), - CONSTRAINT `tag_id_refs_id_43fcb953` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; - - -CREATE TABLE `repute` ( - `id` int(11) NOT NULL auto_increment, - `user_id` int(11) NOT NULL, - `positive` smallint(6) NOT NULL, - `negative` smallint(6) NOT NULL, - `question_id` int(11) NOT NULL, - `reputed_at` datetime NOT NULL, - `reputation_type` smallint(6) NOT NULL, - `reputation` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `repute_user_id` (`user_id`), - KEY `repute_question_id` (`question_id`) -) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; - - -CREATE TABLE `tag` ( - `id` int(11) NOT NULL auto_increment, - `name` varchar(255) NOT NULL, - `created_by_id` int(11) NOT NULL, - `used_count` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `name` (`name`), - KEY `tag_created_by_id` (`created_by_id`), - CONSTRAINT `created_by_id_refs_id_47205d6d` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; - - -CREATE TABLE `user_badge` ( - `id` int(10) unsigned NOT NULL auto_increment, - `user_id` int(10) unsigned NOT NULL, - `badge_id` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `user_favorite_questions` ( - `id` int(10) unsigned NOT NULL auto_increment, - `user_id` int(10) unsigned NOT NULL, - `question_id` int(10) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -CREATE TABLE `vote` ( - `id` int(11) NOT NULL auto_increment, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `user_id` int(11) NOT NULL, - `vote` smallint(6) NOT NULL, - `voted_at` datetime NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), - KEY `vote_content_type_id` (`content_type_id`), - KEY `vote_user_id` (`user_id`), - CONSTRAINT `content_type_id_refs_id_50124414` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `user_id_refs_id_760a4df0` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; - - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/sql_scripts/cnprog_new_install_2009_03_31.sql b/sql_scripts/cnprog_new_install_2009_03_31.sql deleted file mode 100644 index c2c69f36..00000000 --- a/sql_scripts/cnprog_new_install_2009_03_31.sql +++ /dev/null @@ -1,891 +0,0 @@ -USE cnprog; - - -/************ Update: Tables ***************/ - -/******************** Add Table: activity ************************/ - -/* Build Table Structure */ -CREATE TABLE activity -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - activity_type SMALLINT NOT NULL, - active_at DATETIME NOT NULL, - content_type_id INTEGER NOT NULL, - object_id INTEGER UNSIGNED NOT NULL, - is_auditted TINYINT NULL DEFAULT 0 -) ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=latin1; - -/* Table Items: activity */ - -/* Add Indexes for: activity */ -CREATE INDEX activity_content_type_id ON activity (content_type_id); -CREATE INDEX activity_user_id ON activity (user_id); - -/******************** Add Table: answer ************************/ - -/* Build Table Structure */ -CREATE TABLE answer -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - question_id INTEGER NOT NULL, - author_id INTEGER NOT NULL, - added_at DATETIME NOT NULL, - wiki TINYINT NOT NULL, - wikified_at DATETIME NULL, - accepted TINYINT NOT NULL, - deleted TINYINT NOT NULL, - deleted_by_id INTEGER NULL, - locked TINYINT NOT NULL, - locked_by_id INTEGER NULL, - locked_at DATETIME NULL, - score INTEGER NOT NULL, - comment_count INTEGER UNSIGNED NOT NULL, - offensive_flag_count SMALLINT NOT NULL, - last_edited_at DATETIME NULL, - last_edited_by_id INTEGER NULL, - html LONGTEXT NOT NULL, - vote_up_count INTEGER NOT NULL, - vote_down_count INTEGER NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; - -/* Table Items: answer */ - -/* Add Indexes for: answer */ -CREATE INDEX answer_author_id ON answer (author_id); -CREATE INDEX answer_deleted_by_id ON answer (deleted_by_id); -CREATE INDEX answer_last_edited_by_id ON answer (last_edited_by_id); -CREATE INDEX answer_locked_by_id ON answer (locked_by_id); -CREATE INDEX answer_question_id ON answer (question_id); - -/******************** Add Table: answer_revision ************************/ - -/* Build Table Structure */ -CREATE TABLE answer_revision -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - answer_id INTEGER NOT NULL, - revision INTEGER UNSIGNED NOT NULL, - author_id INTEGER NOT NULL, - revised_at DATETIME NOT NULL, - summary TEXT NOT NULL, - `text` LONGTEXT NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - -/* Table Items: answer_revision */ - -/* Add Indexes for: answer_revision */ -CREATE INDEX answer_revision_answer_id ON answer_revision (answer_id); -CREATE INDEX answer_revision_author_id ON answer_revision (author_id); - -/******************** Add Table: auth_group ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_group -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(80) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: auth_group */ - -/* Add Indexes for: auth_group */ -CREATE UNIQUE INDEX name ON auth_group (name); - -/******************** Add Table: auth_group_permissions ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_group_permissions -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - group_id INTEGER NOT NULL, - permission_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: auth_group_permissions */ - -/* Add Indexes for: auth_group_permissions */ -CREATE UNIQUE INDEX group_id ON auth_group_permissions (group_id, permission_id); -CREATE INDEX permission_id_refs_id_5886d21f ON auth_group_permissions (permission_id); - -/******************** Add Table: auth_message ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_message -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - message LONGTEXT NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; - -/* Table Items: auth_message */ - -/* Add Indexes for: auth_message */ -CREATE INDEX auth_message_user_id ON auth_message (user_id); - -/******************** Add Table: auth_permission ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_permission -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(50) NOT NULL, - content_type_id INTEGER NOT NULL, - codename VARCHAR(100) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8; - -/* Table Items: auth_permission */ - -/* Add Indexes for: auth_permission */ -CREATE INDEX auth_permission_content_type_id ON auth_permission (content_type_id); -CREATE UNIQUE INDEX content_type_id ON auth_permission (content_type_id, codename); - -/******************** Add Table: auth_user ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_user -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - username VARCHAR(30) NOT NULL, - first_name VARCHAR(30) NOT NULL, - last_name VARCHAR(30) NOT NULL, - email VARCHAR(75) NOT NULL, - password VARCHAR(128) NOT NULL, - is_staff TINYINT NOT NULL, - is_active TINYINT NOT NULL, - is_superuser TINYINT NOT NULL, - last_login DATETIME NOT NULL, - date_joined DATETIME NOT NULL, - gold SMALLINT NOT NULL DEFAULT 0, - silver SMALLINT UNSIGNED NOT NULL DEFAULT 0, - bronze SMALLINT UNSIGNED NOT NULL DEFAULT 0, - reputation INTEGER UNSIGNED NULL DEFAULT 1, - gravatar VARCHAR(128) NULL, - questions_per_page SMALLINT UNSIGNED NULL DEFAULT 10, - last_seen DATETIME NULL, - real_name VARCHAR(100) NULL, - website VARCHAR(200) NULL, - location VARCHAR(100) NULL, - date_of_birth DATETIME NULL, - about TEXT NULL -) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; - -/* Table Items: auth_user */ - -/* Add Indexes for: auth_user */ -CREATE UNIQUE INDEX username ON auth_user (username); - -/******************** Add Table: auth_user_groups ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_user_groups -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - group_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: auth_user_groups */ - -/* Add Indexes for: auth_user_groups */ -CREATE INDEX group_id_refs_id_f116770 ON auth_user_groups (group_id); -CREATE UNIQUE INDEX user_id ON auth_user_groups (user_id, group_id); - -/******************** Add Table: auth_user_user_permissions ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_user_user_permissions -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - permission_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: auth_user_user_permissions */ - -/* Add Indexes for: auth_user_user_permissions */ -CREATE INDEX permission_id_refs_id_67e79cb ON auth_user_user_permissions (permission_id); -CREATE UNIQUE INDEX user_id ON auth_user_user_permissions (user_id, permission_id); - -/******************** Add Table: award ************************/ - -/* Build Table Structure */ -CREATE TABLE award -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - badge_id INTEGER NOT NULL, - awarded_at DATETIME NOT NULL, - notified TINYINT NOT NULL, - content_type_id INTEGER NULL, - object_id INTEGER NULL -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; - -/* Table Items: award */ - -/* Add Indexes for: award */ -CREATE INDEX award_badge_id ON award (badge_id); -CREATE INDEX award_user_id ON award (user_id); - -/******************** Add Table: badge ************************/ - -/* Build Table Structure */ -CREATE TABLE badge -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(50) NOT NULL, - `type` SMALLINT NOT NULL, - slug VARCHAR(50) NOT NULL, - description TEXT NOT NULL, - multiple TINYINT NOT NULL, - awarded_count INTEGER UNSIGNED NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; - -/* Table Items: badge */ - -/* Add Indexes for: badge */ -CREATE INDEX badge_slug ON badge (slug); -CREATE UNIQUE INDEX name ON badge (name, `type`); - -/******************** Add Table: book ************************/ - -/* Build Table Structure */ -CREATE TABLE book -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - title VARCHAR(255) NOT NULL, - short_name VARCHAR(255) NOT NULL, - author VARCHAR(255) NOT NULL, - user_id INTEGER NULL, - price DECIMAL(10, 2) NULL, - pages SMALLINT NULL, - published_at DATE NOT NULL, - publication VARCHAR(255) NOT NULL, - cover_img VARCHAR(255) NULL, - tagnames VARCHAR(125) NULL, - added_at DATETIME NOT NULL, - last_edited_at DATETIME NOT NULL -) TYPE=InnoDB; - -/* Table Items: book */ - -/* Add Indexes for: book */ -CREATE UNIQUE INDEX book_short_name_Idx ON book (short_name); -CREATE INDEX fk_books_auth_user ON book (user_id); - -/******************** Add Table: book_author_info ************************/ - -/* Build Table Structure */ -CREATE TABLE book_author_info -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - blog_url VARCHAR(255) NULL, - user_id INTEGER NOT NULL, - added_at DATETIME NOT NULL, - last_edited_at DATETIME NOT NULL -) TYPE=InnoDB; - -/* Table Items: book_author_info */ - -/* Add Indexes for: book_author_info */ -CREATE INDEX fk_book_author_info_auth_user ON book_author_info (user_id); - -/******************** Add Table: book_author_rss ************************/ - -/* Build Table Structure */ -CREATE TABLE book_author_rss -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - title VARCHAR(255) NOT NULL, - url VARCHAR(255) NOT NULL, - rss_created_at DATETIME NOT NULL, - user_id INTEGER NOT NULL, - added_at DATETIME NOT NULL -) TYPE=InnoDB; - -/* Table Items: book_author_rss */ - -/* Add Indexes for: book_author_rss */ -CREATE INDEX fk_book_author_rss_auth_user ON book_author_rss (user_id); - -/******************** Add Table: book_question ************************/ - -/* Build Table Structure */ -CREATE TABLE book_question -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - book_id INTEGER NOT NULL, - question_id INTEGER NOT NULL -) TYPE=InnoDB; - -/* Table Items: book_question */ - -/* Add Indexes for: book_question */ -CREATE INDEX fk_book_question_book ON book_question (book_id); -CREATE INDEX fk_book_question_question ON book_question (question_id); - -/******************** Add Table: `comment` ************************/ - -/* Build Table Structure */ -CREATE TABLE `comment` -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - content_type_id INTEGER NOT NULL, - object_id INTEGER UNSIGNED NOT NULL, - user_id INTEGER NOT NULL, - `comment` TEXT NOT NULL, - added_at DATETIME NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; - -/* Table Items: `comment` */ - -/* Add Indexes for: comment */ -CREATE INDEX comment_content_type_id ON `comment` (content_type_id); -CREATE INDEX comment_user_id ON `comment` (user_id); -CREATE INDEX content_type_id ON `comment` (content_type_id, object_id, user_id); - -/******************** Add Table: django_admin_log ************************/ - -/* Build Table Structure */ -CREATE TABLE django_admin_log -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - action_time DATETIME NOT NULL, - user_id INTEGER NOT NULL, - content_type_id INTEGER NULL, - object_id LONGTEXT NULL, - object_repr VARCHAR(200) NOT NULL, - action_flag SMALLINT UNSIGNED NOT NULL, - change_message LONGTEXT NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - -/* Table Items: django_admin_log */ - -/* Add Indexes for: django_admin_log */ -CREATE INDEX django_admin_log_content_type_id ON django_admin_log (content_type_id); -CREATE INDEX django_admin_log_user_id ON django_admin_log (user_id); - -/******************** Add Table: django_authopenid_association ************************/ - -/* Build Table Structure */ -CREATE TABLE django_authopenid_association -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - server_url LONGTEXT NOT NULL, - handle VARCHAR(255) NOT NULL, - secret LONGTEXT NOT NULL, - issued INTEGER NOT NULL, - lifetime INTEGER NOT NULL, - assoc_type LONGTEXT NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; - -/******************** Add Table: django_authopenid_nonce ************************/ - -/* Build Table Structure */ -CREATE TABLE django_authopenid_nonce -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - server_url VARCHAR(255) NOT NULL, - `timestamp` INTEGER NOT NULL, - salt VARCHAR(40) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; - -/******************** Add Table: django_authopenid_userassociation ************************/ - -/* Build Table Structure */ -CREATE TABLE django_authopenid_userassociation -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - openid_url VARCHAR(255) NOT NULL, - user_id INTEGER NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - -/* Table Items: django_authopenid_userassociation */ - -/* Add Indexes for: django_authopenid_userassociation */ -CREATE UNIQUE INDEX user_id ON django_authopenid_userassociation (user_id); - -/******************** Add Table: django_authopenid_userpasswordqueue ************************/ - -/* Build Table Structure */ -CREATE TABLE django_authopenid_userpasswordqueue -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - new_password VARCHAR(30) NOT NULL, - confirm_key VARCHAR(40) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: django_authopenid_userpasswordqueue */ - -/* Add Indexes for: django_authopenid_userpasswordqueue */ -CREATE UNIQUE INDEX user_id ON django_authopenid_userpasswordqueue (user_id); - -/******************** Add Table: django_content_type ************************/ - -/* Build Table Structure */ -CREATE TABLE django_content_type -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(100) NOT NULL, - app_label VARCHAR(100) NOT NULL, - model VARCHAR(100) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; - -/* Table Items: django_content_type */ - -/* Add Indexes for: django_content_type */ -CREATE UNIQUE INDEX app_label ON django_content_type (app_label, model); - -/******************** Add Table: django_session ************************/ - -/* Build Table Structure */ -CREATE TABLE django_session -( - session_key VARCHAR(40) NOT NULL, - session_data LONGTEXT NOT NULL, - expire_date DATETIME NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: django_session */ -ALTER TABLE django_session ADD CONSTRAINT pkdjango_session - PRIMARY KEY (session_key); - -/******************** Add Table: django_site ************************/ - -/* Build Table Structure */ -CREATE TABLE django_site -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - domain VARCHAR(100) NOT NULL, - name VARCHAR(50) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - -/******************** Add Table: favorite_question ************************/ - -/* Build Table Structure */ -CREATE TABLE favorite_question -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - question_id INTEGER NOT NULL, - user_id INTEGER NOT NULL, - added_at DATETIME NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - -/* Table Items: favorite_question */ - -/* Add Indexes for: favorite_question */ -CREATE INDEX favorite_question_question_id ON favorite_question (question_id); -CREATE INDEX favorite_question_user_id ON favorite_question (user_id); - -/******************** Add Table: flagged_item ************************/ - -/* Build Table Structure */ -CREATE TABLE flagged_item -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - content_type_id INTEGER NOT NULL, - object_id INTEGER UNSIGNED NOT NULL, - user_id INTEGER NOT NULL, - flagged_at DATETIME NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; - -/* Table Items: flagged_item */ - -/* Add Indexes for: flagged_item */ -CREATE UNIQUE INDEX content_type_id ON flagged_item (content_type_id, object_id, user_id); -CREATE INDEX flagged_item_content_type_id ON flagged_item (content_type_id); -CREATE INDEX flagged_item_user_id ON flagged_item (user_id); - -/******************** Add Table: question ************************/ - -/* Build Table Structure */ -CREATE TABLE question -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - title TEXT NOT NULL, - author_id INTEGER NOT NULL, - added_at DATETIME NOT NULL, - wiki TINYINT NOT NULL, - wikified_at DATETIME NULL, - answer_accepted TINYINT NOT NULL, - closed TINYINT NOT NULL, - closed_by_id INTEGER NULL, - closed_at DATETIME NULL, - close_reason SMALLINT NULL, - deleted TINYINT NOT NULL, - deleted_at DATETIME NULL, - deleted_by_id INTEGER NULL, - locked TINYINT NOT NULL, - locked_by_id INTEGER NULL, - locked_at DATETIME NULL, - score INTEGER NOT NULL, - answer_count INTEGER UNSIGNED NOT NULL, - comment_count INTEGER UNSIGNED NOT NULL, - view_count INTEGER UNSIGNED NOT NULL, - offensive_flag_count SMALLINT NOT NULL, - favourite_count INTEGER UNSIGNED NOT NULL, - last_edited_at DATETIME NULL, - last_edited_by_id INTEGER NULL, - last_activity_at DATETIME NOT NULL, - last_activity_by_id INTEGER NOT NULL, - tagnames VARCHAR(125) NOT NULL, - summary VARCHAR(180) NOT NULL, - html LONGTEXT NOT NULL, - vote_up_count INTEGER NOT NULL, - vote_down_count INTEGER NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; - -/* Table Items: question */ - -/* Add Indexes for: question */ -CREATE INDEX question_author_id ON question (author_id); -CREATE INDEX question_closed_by_id ON question (closed_by_id); -CREATE INDEX question_deleted_by_id ON question (deleted_by_id); -CREATE INDEX question_last_activity_by_id ON question (last_activity_by_id); -CREATE INDEX question_last_edited_by_id ON question (last_edited_by_id); -CREATE INDEX question_locked_by_id ON question (locked_by_id); - -/******************** Add Table: question_revision ************************/ - -/* Build Table Structure */ -CREATE TABLE question_revision -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - question_id INTEGER NOT NULL, - revision INTEGER UNSIGNED NOT NULL, - title TEXT NOT NULL, - author_id INTEGER NOT NULL, - revised_at DATETIME NOT NULL, - tagnames VARCHAR(125) NOT NULL, - summary TEXT NOT NULL, - `text` LONGTEXT NOT NULL -) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; - -/* Table Items: question_revision */ - -/* Add Indexes for: question_revision */ -CREATE INDEX question_revision_author_id ON question_revision (author_id); -CREATE INDEX question_revision_question_id ON question_revision (question_id); - -/******************** Add Table: question_tags ************************/ - -/* Build Table Structure */ -CREATE TABLE question_tags -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - question_id INTEGER NOT NULL, - tag_id INTEGER NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; - -/* Table Items: question_tags */ - -/* Add Indexes for: question_tags */ -CREATE UNIQUE INDEX question_id ON question_tags (question_id, tag_id); -CREATE INDEX tag_id_refs_id_43fcb953 ON question_tags (tag_id); - -/******************** Add Table: repute ************************/ - -/* Build Table Structure */ -CREATE TABLE repute -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - positive SMALLINT NOT NULL, - negative SMALLINT NOT NULL, - question_id INTEGER NOT NULL, - reputed_at DATETIME NOT NULL, - reputation_type SMALLINT NOT NULL, - reputation INTEGER NOT NULL -) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; - -/* Table Items: repute */ - -/* Add Indexes for: repute */ -CREATE INDEX repute_question_id ON repute (question_id); -CREATE INDEX repute_user_id ON repute (user_id); - -/******************** Add Table: tag ************************/ - -/* Build Table Structure */ -CREATE TABLE tag -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(255) NOT NULL, - created_by_id INTEGER NOT NULL, - used_count INTEGER UNSIGNED NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; - -/* Table Items: tag */ - -/* Add Indexes for: tag */ -CREATE UNIQUE INDEX name ON tag (name); -CREATE INDEX tag_created_by_id ON tag (created_by_id); - -/******************** Add Table: user_badge ************************/ - -/* Build Table Structure */ -CREATE TABLE user_badge -( - id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - badge_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: user_badge */ - -/* Add Indexes for: user_badge */ -CREATE INDEX fk_user_badge_auth_user ON user_badge (user_id); -CREATE INDEX fk_user_badge_badge ON user_badge (badge_id); - -/******************** Add Table: user_favorite_questions ************************/ - -/* Build Table Structure */ -CREATE TABLE user_favorite_questions -( - id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - question_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: user_favorite_questions */ - -/* Add Indexes for: user_favorite_questions */ -CREATE INDEX fk_user_favorite_questions_auth_user ON user_favorite_questions (user_id); -CREATE INDEX fk_user_favorite_questions_question ON user_favorite_questions (question_id); - -/******************** Add Table: vote ************************/ - -/* Build Table Structure */ -CREATE TABLE vote -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - content_type_id INTEGER NOT NULL, - object_id INTEGER UNSIGNED NOT NULL, - user_id INTEGER NOT NULL, - vote SMALLINT NOT NULL, - voted_at DATETIME NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; - -/* Table Items: vote */ - -/* Add Indexes for: vote */ -CREATE UNIQUE INDEX content_type_id ON vote (content_type_id, object_id, user_id); -CREATE INDEX vote_content_type_id ON vote (content_type_id); -CREATE INDEX vote_user_id ON vote (user_id); - - -/************ Add Foreign Keys to Database ***************/ -/*----------------------------------------------------------- -Warning: Versions of MySQL prior to 4.1.2 require indexes on all columns involved in a foreign key. The following indexes may be required: -fk_auth_group_permissions_auth_group may require an index on table: auth_group_permissions, column: group_id -fk_auth_user_groups_auth_user may require an index on table: auth_user_groups, column: user_id -fk_auth_user_user_permissions_auth_user may require an index on table: auth_user_user_permissions, column: user_id -fk_question_tags_question may require an index on table: question_tags, column: question_id ------------------------------------------------------------ -*/ - -/************ Foreign Key: fk_activity_auth_user ***************/ -ALTER TABLE activity ADD CONSTRAINT fk_activity_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: deleted_by_id_refs_id_192b0170 ***************/ -ALTER TABLE answer ADD CONSTRAINT deleted_by_id_refs_id_192b0170 - FOREIGN KEY (deleted_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_answer_auth_user ***************/ -ALTER TABLE answer ADD CONSTRAINT fk_answer_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_answer_question ***************/ -ALTER TABLE answer ADD CONSTRAINT fk_answer_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: last_edited_by_id_refs_id_192b0170 ***************/ -ALTER TABLE answer ADD CONSTRAINT last_edited_by_id_refs_id_192b0170 - FOREIGN KEY (last_edited_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: locked_by_id_refs_id_192b0170 ***************/ -ALTER TABLE answer ADD CONSTRAINT locked_by_id_refs_id_192b0170 - FOREIGN KEY (locked_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_answer_revision_auth_user ***************/ -ALTER TABLE answer_revision ADD CONSTRAINT fk_answer_revision_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_group_permissions_auth_group ***************/ -ALTER TABLE auth_group_permissions ADD CONSTRAINT fk_auth_group_permissions_auth_group - FOREIGN KEY (group_id) REFERENCES auth_group (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_group_permissions_auth_permission ***************/ -ALTER TABLE auth_group_permissions ADD CONSTRAINT fk_auth_group_permissions_auth_permission - FOREIGN KEY (permission_id) REFERENCES auth_permission (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_message_auth_user ***************/ -ALTER TABLE auth_message ADD CONSTRAINT fk_auth_message_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_permission_django_content_type ***************/ -ALTER TABLE auth_permission ADD CONSTRAINT fk_auth_permission_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_user_groups_auth_group ***************/ -ALTER TABLE auth_user_groups ADD CONSTRAINT fk_auth_user_groups_auth_group - FOREIGN KEY (group_id) REFERENCES auth_group (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_user_groups_auth_user ***************/ -ALTER TABLE auth_user_groups ADD CONSTRAINT fk_auth_user_groups_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_user_user_permissions_auth_permission ***************/ -ALTER TABLE auth_user_user_permissions ADD CONSTRAINT fk_auth_user_user_permissions_auth_permission - FOREIGN KEY (permission_id) REFERENCES auth_permission (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_user_user_permissions_auth_user ***************/ -ALTER TABLE auth_user_user_permissions ADD CONSTRAINT fk_auth_user_user_permissions_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_award_auth_user ***************/ -ALTER TABLE award ADD CONSTRAINT fk_award_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_award_badge ***************/ -ALTER TABLE award ADD CONSTRAINT fk_award_badge - FOREIGN KEY (badge_id) REFERENCES badge (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_books_auth_user ***************/ -ALTER TABLE book ADD CONSTRAINT fk_books_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_author_info_auth_user ***************/ -ALTER TABLE book_author_info ADD CONSTRAINT fk_book_author_info_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_author_rss_auth_user ***************/ -ALTER TABLE book_author_rss ADD CONSTRAINT fk_book_author_rss_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_question_book ***************/ -ALTER TABLE book_question ADD CONSTRAINT fk_book_question_book - FOREIGN KEY (book_id) REFERENCES book (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_question_question ***************/ -ALTER TABLE book_question ADD CONSTRAINT fk_book_question_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_comment_auth_user ***************/ -ALTER TABLE `comment` ADD CONSTRAINT fk_comment_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_comment_django_content_type ***************/ -ALTER TABLE `comment` ADD CONSTRAINT fk_comment_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_django_admin_log_auth_user ***************/ -ALTER TABLE django_admin_log ADD CONSTRAINT fk_django_admin_log_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_django_admin_log_django_content_type ***************/ -ALTER TABLE django_admin_log ADD CONSTRAINT fk_django_admin_log_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_django_authopenid_userassociation_auth_user ***************/ -ALTER TABLE django_authopenid_userassociation ADD CONSTRAINT fk_django_authopenid_userassociation_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_django_authopenid_userpasswordqueue_auth_user ***************/ -ALTER TABLE django_authopenid_userpasswordqueue ADD CONSTRAINT fk_django_authopenid_userpasswordqueue_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_favorite_question_auth_user ***************/ -ALTER TABLE favorite_question ADD CONSTRAINT fk_favorite_question_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_favorite_question_question ***************/ -ALTER TABLE favorite_question ADD CONSTRAINT fk_favorite_question_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_flagged_item_auth_user ***************/ -ALTER TABLE flagged_item ADD CONSTRAINT fk_flagged_item_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_flagged_item_django_content_type ***************/ -ALTER TABLE flagged_item ADD CONSTRAINT fk_flagged_item_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: closed_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT closed_by_id_refs_id_56e9d00c - FOREIGN KEY (closed_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: deleted_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT deleted_by_id_refs_id_56e9d00c - FOREIGN KEY (deleted_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_auth_user ***************/ -ALTER TABLE question ADD CONSTRAINT fk_question_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: last_activity_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT last_activity_by_id_refs_id_56e9d00c - FOREIGN KEY (last_activity_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: last_edited_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT last_edited_by_id_refs_id_56e9d00c - FOREIGN KEY (last_edited_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: locked_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT locked_by_id_refs_id_56e9d00c - FOREIGN KEY (locked_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_revision_auth_user ***************/ -ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_revision_question ***************/ -ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_tags_question ***************/ -ALTER TABLE question_tags ADD CONSTRAINT fk_question_tags_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_tags_tag ***************/ -ALTER TABLE question_tags ADD CONSTRAINT fk_question_tags_tag - FOREIGN KEY (tag_id) REFERENCES tag (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_repute_auth_user ***************/ -ALTER TABLE repute ADD CONSTRAINT fk_repute_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_repute_question ***************/ -ALTER TABLE repute ADD CONSTRAINT fk_repute_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_tag_auth_user ***************/ -ALTER TABLE tag ADD CONSTRAINT fk_tag_auth_user - FOREIGN KEY (created_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_user_badge_auth_user ***************/ -ALTER TABLE user_badge ADD CONSTRAINT fk_user_badge_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_user_badge_badge ***************/ -ALTER TABLE user_badge ADD CONSTRAINT fk_user_badge_badge - FOREIGN KEY (badge_id) REFERENCES badge (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_user_favorite_questions_auth_user ***************/ -ALTER TABLE user_favorite_questions ADD CONSTRAINT fk_user_favorite_questions_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_user_favorite_questions_question ***************/ -ALTER TABLE user_favorite_questions ADD CONSTRAINT fk_user_favorite_questions_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_vote_auth_user ***************/ -ALTER TABLE vote ADD CONSTRAINT fk_vote_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_vote_django_content_type ***************/ -ALTER TABLE vote ADD CONSTRAINT fk_vote_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; \ No newline at end of file diff --git a/sql_scripts/cnprog_new_install_2009_04_07.sql b/sql_scripts/cnprog_new_install_2009_04_07.sql deleted file mode 100644 index ff9016fa..00000000 --- a/sql_scripts/cnprog_new_install_2009_04_07.sql +++ /dev/null @@ -1,24 +0,0 @@ -USE cnprog; - - -/************ Add Foreign Keys to Database ***************/ - -/************ Foreign Key: fk_activity_auth_user ***************/ -ALTER TABLE activity ADD CONSTRAINT fk_activity_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_revision_auth_user ***************/ -ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_revision_question ***************/ -ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_repute_auth_user ***************/ -ALTER TABLE repute ADD CONSTRAINT fk_repute_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_repute_question ***************/ -ALTER TABLE repute ADD CONSTRAINT fk_repute_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; \ No newline at end of file diff --git a/sql_scripts/cnprog_new_install_2009_04_09.sql b/sql_scripts/cnprog_new_install_2009_04_09.sql deleted file mode 100644 index f4424852..00000000 --- a/sql_scripts/cnprog_new_install_2009_04_09.sql +++ /dev/null @@ -1,904 +0,0 @@ -USE cnprog; - - -/************ Update: Tables ***************/ - -/******************** Add Table: activity ************************/ - -/* Build Table Structure */ -CREATE TABLE activity -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - activity_type SMALLINT NOT NULL, - active_at DATETIME NOT NULL, - content_type_id INTEGER NOT NULL, - object_id INTEGER UNSIGNED NOT NULL, - is_auditted TINYINT NULL DEFAULT 0 -) ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=latin1; - -/* Table Items: activity */ - -/* Add Indexes for: activity */ -CREATE INDEX activity_content_type_id ON activity (content_type_id); -CREATE INDEX activity_user_id ON activity (user_id); - -/******************** Add Table: answer ************************/ - -/* Build Table Structure */ -CREATE TABLE answer -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - question_id INTEGER NOT NULL, - author_id INTEGER NOT NULL, - added_at DATETIME NOT NULL, - wiki TINYINT NOT NULL, - wikified_at DATETIME NULL, - accepted TINYINT NOT NULL, - deleted TINYINT NOT NULL, - deleted_by_id INTEGER NULL, - locked TINYINT NOT NULL, - locked_by_id INTEGER NULL, - locked_at DATETIME NULL, - score INTEGER NOT NULL, - comment_count INTEGER UNSIGNED NOT NULL, - offensive_flag_count SMALLINT NOT NULL, - last_edited_at DATETIME NULL, - last_edited_by_id INTEGER NULL, - html LONGTEXT NOT NULL, - vote_up_count INTEGER NOT NULL, - vote_down_count INTEGER NOT NULL, - accepted_at DATETIME NULL -) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; - -/* Table Items: answer */ - -/* Add Indexes for: answer */ -CREATE INDEX answer_author_id ON answer (author_id); -CREATE INDEX answer_deleted_by_id ON answer (deleted_by_id); -CREATE INDEX answer_last_edited_by_id ON answer (last_edited_by_id); -CREATE INDEX answer_locked_by_id ON answer (locked_by_id); -CREATE INDEX answer_question_id ON answer (question_id); - -/******************** Add Table: answer_revision ************************/ - -/* Build Table Structure */ -CREATE TABLE answer_revision -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - answer_id INTEGER NOT NULL, - revision INTEGER UNSIGNED NOT NULL, - author_id INTEGER NOT NULL, - revised_at DATETIME NOT NULL, - summary TEXT NOT NULL, - `text` LONGTEXT NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - -/* Table Items: answer_revision */ - -/* Add Indexes for: answer_revision */ -CREATE INDEX answer_revision_answer_id ON answer_revision (answer_id); -CREATE INDEX answer_revision_author_id ON answer_revision (author_id); - -/******************** Add Table: auth_group ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_group -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(80) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: auth_group */ - -/* Add Indexes for: auth_group */ -CREATE UNIQUE INDEX name ON auth_group (name); - -/******************** Add Table: auth_group_permissions ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_group_permissions -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - group_id INTEGER NOT NULL, - permission_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: auth_group_permissions */ - -/* Add Indexes for: auth_group_permissions */ -CREATE UNIQUE INDEX group_id ON auth_group_permissions (group_id, permission_id); -CREATE INDEX permission_id_refs_id_5886d21f ON auth_group_permissions (permission_id); - -/******************** Add Table: auth_message ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_message -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - message LONGTEXT NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; - -/* Table Items: auth_message */ - -/* Add Indexes for: auth_message */ -CREATE INDEX auth_message_user_id ON auth_message (user_id); - -/******************** Add Table: auth_permission ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_permission -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(50) NOT NULL, - content_type_id INTEGER NOT NULL, - codename VARCHAR(100) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8; - -/* Table Items: auth_permission */ - -/* Add Indexes for: auth_permission */ -CREATE INDEX auth_permission_content_type_id ON auth_permission (content_type_id); -CREATE UNIQUE INDEX content_type_id ON auth_permission (content_type_id, codename); - -/******************** Add Table: auth_user ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_user -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - username VARCHAR(30) NOT NULL, - first_name VARCHAR(30) NOT NULL, - last_name VARCHAR(30) NOT NULL, - email VARCHAR(75) NOT NULL, - password VARCHAR(128) NOT NULL, - is_staff TINYINT NOT NULL, - is_active TINYINT NOT NULL, - is_superuser TINYINT NOT NULL, - last_login DATETIME NOT NULL, - date_joined DATETIME NOT NULL, - gold SMALLINT NOT NULL DEFAULT 0, - silver SMALLINT UNSIGNED NOT NULL DEFAULT 0, - bronze SMALLINT UNSIGNED NOT NULL DEFAULT 0, - reputation INTEGER UNSIGNED NULL DEFAULT 1, - gravatar VARCHAR(128) NULL, - questions_per_page SMALLINT UNSIGNED NULL DEFAULT 10, - last_seen DATETIME NULL, - real_name VARCHAR(100) NULL, - website VARCHAR(200) NULL, - location VARCHAR(100) NULL, - date_of_birth DATETIME NULL, - about TEXT NULL -) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; - -/* Table Items: auth_user */ - -/* Add Indexes for: auth_user */ -CREATE UNIQUE INDEX username ON auth_user (username); - -/******************** Add Table: auth_user_groups ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_user_groups -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - group_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: auth_user_groups */ - -/* Add Indexes for: auth_user_groups */ -CREATE INDEX group_id_refs_id_f116770 ON auth_user_groups (group_id); -CREATE UNIQUE INDEX user_id ON auth_user_groups (user_id, group_id); - -/******************** Add Table: auth_user_user_permissions ************************/ - -/* Build Table Structure */ -CREATE TABLE auth_user_user_permissions -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - permission_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: auth_user_user_permissions */ - -/* Add Indexes for: auth_user_user_permissions */ -CREATE INDEX permission_id_refs_id_67e79cb ON auth_user_user_permissions (permission_id); -CREATE UNIQUE INDEX user_id ON auth_user_user_permissions (user_id, permission_id); - -/******************** Add Table: award ************************/ - -/* Build Table Structure */ -CREATE TABLE award -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - badge_id INTEGER NOT NULL, - awarded_at DATETIME NOT NULL, - notified TINYINT NOT NULL, - content_type_id INTEGER NULL, - object_id INTEGER NULL -) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; - -/* Table Items: award */ - -/* Add Indexes for: award */ -CREATE INDEX award_badge_id ON award (badge_id); -CREATE INDEX award_user_id ON award (user_id); - -/******************** Add Table: badge ************************/ - -/* Build Table Structure */ -CREATE TABLE badge -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(50) NOT NULL, - `type` SMALLINT NOT NULL, - slug VARCHAR(50) NOT NULL, - description TEXT NOT NULL, - multiple TINYINT NOT NULL, - awarded_count INTEGER UNSIGNED NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; - -/* Table Items: badge */ - -/* Add Indexes for: badge */ -CREATE INDEX badge_slug ON badge (slug); -CREATE UNIQUE INDEX name ON badge (name, `type`); - -/******************** Add Table: book ************************/ - -/* Build Table Structure */ -CREATE TABLE book -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - title VARCHAR(255) NOT NULL, - short_name VARCHAR(255) NOT NULL, - author VARCHAR(255) NOT NULL, - user_id INTEGER NULL, - price DECIMAL(10, 2) NULL, - pages SMALLINT NULL, - published_at DATE NOT NULL, - publication VARCHAR(255) NOT NULL, - cover_img VARCHAR(255) NULL, - tagnames VARCHAR(125) NULL, - added_at DATETIME NOT NULL, - last_edited_at DATETIME NOT NULL -) TYPE=InnoDB; - -/* Table Items: book */ - -/* Add Indexes for: book */ -CREATE UNIQUE INDEX book_short_name_Idx ON book (short_name); -CREATE INDEX fk_books_auth_user ON book (user_id); - -/******************** Add Table: book_author_info ************************/ - -/* Build Table Structure */ -CREATE TABLE book_author_info -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - blog_url VARCHAR(255) NULL, - user_id INTEGER NOT NULL, - added_at DATETIME NOT NULL, - last_edited_at DATETIME NOT NULL, - book_id INTEGER NOT NULL -) TYPE=InnoDB; - -/* Table Items: book_author_info */ - -/* Add Indexes for: book_author_info */ -CREATE INDEX fk_book_author_info_auth_user ON book_author_info (user_id); -CREATE INDEX fk_book_author_info_book ON book_author_info (book_id); - -/******************** Add Table: book_author_rss ************************/ - -/* Build Table Structure */ -CREATE TABLE book_author_rss -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - title VARCHAR(255) NOT NULL, - url VARCHAR(255) NOT NULL, - rss_created_at DATETIME NOT NULL, - user_id INTEGER NOT NULL, - added_at DATETIME NOT NULL, - book_id INTEGER NOT NULL -) TYPE=InnoDB; - -/* Table Items: book_author_rss */ - -/* Add Indexes for: book_author_rss */ -CREATE INDEX fk_book_author_rss_auth_user ON book_author_rss (user_id); -CREATE INDEX fk_book_author_rss_book ON book_author_rss (book_id); - -/******************** Add Table: book_question ************************/ - -/* Build Table Structure */ -CREATE TABLE book_question -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - book_id INTEGER NOT NULL, - question_id INTEGER NOT NULL -) TYPE=InnoDB; - -/* Table Items: book_question */ - -/* Add Indexes for: book_question */ -CREATE INDEX fk_book_question_book ON book_question (book_id); -CREATE INDEX fk_book_question_question ON book_question (question_id); - -/******************** Add Table: `comment` ************************/ - -/* Build Table Structure */ -CREATE TABLE `comment` -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - content_type_id INTEGER NOT NULL, - object_id INTEGER UNSIGNED NOT NULL, - user_id INTEGER NOT NULL, - `comment` TEXT NOT NULL, - added_at DATETIME NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; - -/* Table Items: `comment` */ - -/* Add Indexes for: comment */ -CREATE INDEX comment_content_type_id ON `comment` (content_type_id); -CREATE INDEX comment_user_id ON `comment` (user_id); -CREATE INDEX content_type_id ON `comment` (content_type_id, object_id, user_id); - -/******************** Add Table: django_admin_log ************************/ - -/* Build Table Structure */ -CREATE TABLE django_admin_log -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - action_time DATETIME NOT NULL, - user_id INTEGER NOT NULL, - content_type_id INTEGER NULL, - object_id LONGTEXT NULL, - object_repr VARCHAR(200) NOT NULL, - action_flag SMALLINT UNSIGNED NOT NULL, - change_message LONGTEXT NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - -/* Table Items: django_admin_log */ - -/* Add Indexes for: django_admin_log */ -CREATE INDEX django_admin_log_content_type_id ON django_admin_log (content_type_id); -CREATE INDEX django_admin_log_user_id ON django_admin_log (user_id); - -/******************** Add Table: django_authopenid_association ************************/ - -/* Build Table Structure */ -CREATE TABLE django_authopenid_association -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - server_url LONGTEXT NOT NULL, - handle VARCHAR(255) NOT NULL, - secret LONGTEXT NOT NULL, - issued INTEGER NOT NULL, - lifetime INTEGER NOT NULL, - assoc_type LONGTEXT NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; - -/******************** Add Table: django_authopenid_nonce ************************/ - -/* Build Table Structure */ -CREATE TABLE django_authopenid_nonce -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - server_url VARCHAR(255) NOT NULL, - `timestamp` INTEGER NOT NULL, - salt VARCHAR(40) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; - -/******************** Add Table: django_authopenid_userassociation ************************/ - -/* Build Table Structure */ -CREATE TABLE django_authopenid_userassociation -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - openid_url VARCHAR(255) NOT NULL, - user_id INTEGER NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - -/* Table Items: django_authopenid_userassociation */ - -/* Add Indexes for: django_authopenid_userassociation */ -CREATE UNIQUE INDEX user_id ON django_authopenid_userassociation (user_id); - -/******************** Add Table: django_authopenid_userpasswordqueue ************************/ - -/* Build Table Structure */ -CREATE TABLE django_authopenid_userpasswordqueue -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - new_password VARCHAR(30) NOT NULL, - confirm_key VARCHAR(40) NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: django_authopenid_userpasswordqueue */ - -/* Add Indexes for: django_authopenid_userpasswordqueue */ -CREATE UNIQUE INDEX user_id ON django_authopenid_userpasswordqueue (user_id); - -/******************** Add Table: django_content_type ************************/ - -/* Build Table Structure */ -CREATE TABLE django_content_type -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(100) NOT NULL, - app_label VARCHAR(100) NOT NULL, - model VARCHAR(100) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; - -/* Table Items: django_content_type */ - -/* Add Indexes for: django_content_type */ -CREATE UNIQUE INDEX app_label ON django_content_type (app_label, model); - -/******************** Add Table: django_session ************************/ - -/* Build Table Structure */ -CREATE TABLE django_session -( - session_key VARCHAR(40) NOT NULL, - session_data LONGTEXT NOT NULL, - expire_date DATETIME NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: django_session */ -ALTER TABLE django_session ADD CONSTRAINT pkdjango_session - PRIMARY KEY (session_key); - -/******************** Add Table: django_site ************************/ - -/* Build Table Structure */ -CREATE TABLE django_site -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - domain VARCHAR(100) NOT NULL, - name VARCHAR(50) NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; - -/******************** Add Table: favorite_question ************************/ - -/* Build Table Structure */ -CREATE TABLE favorite_question -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - question_id INTEGER NOT NULL, - user_id INTEGER NOT NULL, - added_at DATETIME NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; - -/* Table Items: favorite_question */ - -/* Add Indexes for: favorite_question */ -CREATE INDEX favorite_question_question_id ON favorite_question (question_id); -CREATE INDEX favorite_question_user_id ON favorite_question (user_id); - -/******************** Add Table: flagged_item ************************/ - -/* Build Table Structure */ -CREATE TABLE flagged_item -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - content_type_id INTEGER NOT NULL, - object_id INTEGER UNSIGNED NOT NULL, - user_id INTEGER NOT NULL, - flagged_at DATETIME NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; - -/* Table Items: flagged_item */ - -/* Add Indexes for: flagged_item */ -CREATE UNIQUE INDEX content_type_id ON flagged_item (content_type_id, object_id, user_id); -CREATE INDEX flagged_item_content_type_id ON flagged_item (content_type_id); -CREATE INDEX flagged_item_user_id ON flagged_item (user_id); - -/******************** Add Table: question ************************/ - -/* Build Table Structure */ -CREATE TABLE question -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - title TEXT NOT NULL, - author_id INTEGER NOT NULL, - added_at DATETIME NOT NULL, - wiki TINYINT NOT NULL, - wikified_at DATETIME NULL, - answer_accepted TINYINT NOT NULL, - closed TINYINT NOT NULL, - closed_by_id INTEGER NULL, - closed_at DATETIME NULL, - close_reason SMALLINT NULL, - deleted TINYINT NOT NULL, - deleted_at DATETIME NULL, - deleted_by_id INTEGER NULL, - locked TINYINT NOT NULL, - locked_by_id INTEGER NULL, - locked_at DATETIME NULL, - score INTEGER NOT NULL, - answer_count INTEGER UNSIGNED NOT NULL, - comment_count INTEGER UNSIGNED NOT NULL, - view_count INTEGER UNSIGNED NOT NULL, - offensive_flag_count SMALLINT NOT NULL, - favourite_count INTEGER UNSIGNED NOT NULL, - last_edited_at DATETIME NULL, - last_edited_by_id INTEGER NULL, - last_activity_at DATETIME NOT NULL, - last_activity_by_id INTEGER NOT NULL, - tagnames VARCHAR(125) NOT NULL, - summary VARCHAR(180) NOT NULL, - html LONGTEXT NOT NULL, - vote_up_count INTEGER NOT NULL, - vote_down_count INTEGER NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; - -/* Table Items: question */ - -/* Add Indexes for: question */ -CREATE INDEX question_author_id ON question (author_id); -CREATE INDEX question_closed_by_id ON question (closed_by_id); -CREATE INDEX question_deleted_by_id ON question (deleted_by_id); -CREATE INDEX question_last_activity_by_id ON question (last_activity_by_id); -CREATE INDEX question_last_edited_by_id ON question (last_edited_by_id); -CREATE INDEX question_locked_by_id ON question (locked_by_id); - -/******************** Add Table: question_revision ************************/ - -/* Build Table Structure */ -CREATE TABLE question_revision -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - question_id INTEGER NOT NULL, - revision INTEGER UNSIGNED NOT NULL, - title TEXT NOT NULL, - author_id INTEGER NOT NULL, - revised_at DATETIME NOT NULL, - tagnames VARCHAR(125) NOT NULL, - summary TEXT NOT NULL, - `text` LONGTEXT NOT NULL -) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; - -/* Table Items: question_revision */ - -/* Add Indexes for: question_revision */ -CREATE INDEX question_revision_author_id ON question_revision (author_id); -CREATE INDEX question_revision_question_id ON question_revision (question_id); - -/******************** Add Table: question_tags ************************/ - -/* Build Table Structure */ -CREATE TABLE question_tags -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - question_id INTEGER NOT NULL, - tag_id INTEGER NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; - -/* Table Items: question_tags */ - -/* Add Indexes for: question_tags */ -CREATE UNIQUE INDEX question_id ON question_tags (question_id, tag_id); -CREATE INDEX tag_id_refs_id_43fcb953 ON question_tags (tag_id); - -/******************** Add Table: repute ************************/ - -/* Build Table Structure */ -CREATE TABLE repute -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - positive SMALLINT NOT NULL, - negative SMALLINT NOT NULL, - question_id INTEGER NOT NULL, - reputed_at DATETIME NOT NULL, - reputation_type SMALLINT NOT NULL, - reputation INTEGER NOT NULL -) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; - -/* Table Items: repute */ - -/* Add Indexes for: repute */ -CREATE INDEX repute_question_id ON repute (question_id); -CREATE INDEX repute_user_id ON repute (user_id); - -/******************** Add Table: tag ************************/ - -/* Build Table Structure */ -CREATE TABLE tag -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - name VARCHAR(255) NOT NULL, - created_by_id INTEGER NOT NULL, - used_count INTEGER UNSIGNED NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; - -/* Table Items: tag */ - -/* Add Indexes for: tag */ -CREATE UNIQUE INDEX name ON tag (name); -CREATE INDEX tag_created_by_id ON tag (created_by_id); - -/******************** Add Table: user_badge ************************/ - -/* Build Table Structure */ -CREATE TABLE user_badge -( - id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - badge_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: user_badge */ - -/* Add Indexes for: user_badge */ -CREATE INDEX fk_user_badge_auth_user ON user_badge (user_id); -CREATE INDEX fk_user_badge_badge ON user_badge (badge_id); - -/******************** Add Table: user_favorite_questions ************************/ - -/* Build Table Structure */ -CREATE TABLE user_favorite_questions -( - id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - user_id INTEGER NOT NULL, - question_id INTEGER NOT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -/* Table Items: user_favorite_questions */ - -/* Add Indexes for: user_favorite_questions */ -CREATE INDEX fk_user_favorite_questions_auth_user ON user_favorite_questions (user_id); -CREATE INDEX fk_user_favorite_questions_question ON user_favorite_questions (question_id); - -/******************** Add Table: vote ************************/ - -/* Build Table Structure */ -CREATE TABLE vote -( - id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, - content_type_id INTEGER NOT NULL, - object_id INTEGER UNSIGNED NOT NULL, - user_id INTEGER NOT NULL, - vote SMALLINT NOT NULL, - voted_at DATETIME NOT NULL -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; - -/* Table Items: vote */ - -/* Add Indexes for: vote */ -CREATE UNIQUE INDEX content_type_id ON vote (content_type_id, object_id, user_id); -CREATE INDEX vote_content_type_id ON vote (content_type_id); -CREATE INDEX vote_user_id ON vote (user_id); - - -/************ Add Foreign Keys to Database ***************/ -/*----------------------------------------------------------- -Warning: Versions of MySQL prior to 4.1.2 require indexes on all columns involved in a foreign key. The following indexes may be required: -fk_auth_group_permissions_auth_group may require an index on table: auth_group_permissions, column: group_id -fk_auth_user_groups_auth_user may require an index on table: auth_user_groups, column: user_id -fk_auth_user_user_permissions_auth_user may require an index on table: auth_user_user_permissions, column: user_id -fk_question_tags_question may require an index on table: question_tags, column: question_id ------------------------------------------------------------ -*/ - -/************ Foreign Key: fk_activity_auth_user ***************/ -ALTER TABLE activity ADD CONSTRAINT fk_activity_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: deleted_by_id_refs_id_192b0170 ***************/ -ALTER TABLE answer ADD CONSTRAINT deleted_by_id_refs_id_192b0170 - FOREIGN KEY (deleted_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_answer_auth_user ***************/ -ALTER TABLE answer ADD CONSTRAINT fk_answer_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_answer_question ***************/ -ALTER TABLE answer ADD CONSTRAINT fk_answer_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: last_edited_by_id_refs_id_192b0170 ***************/ -ALTER TABLE answer ADD CONSTRAINT last_edited_by_id_refs_id_192b0170 - FOREIGN KEY (last_edited_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: locked_by_id_refs_id_192b0170 ***************/ -ALTER TABLE answer ADD CONSTRAINT locked_by_id_refs_id_192b0170 - FOREIGN KEY (locked_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_answer_revision_auth_user ***************/ -ALTER TABLE answer_revision ADD CONSTRAINT fk_answer_revision_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_group_permissions_auth_group ***************/ -ALTER TABLE auth_group_permissions ADD CONSTRAINT fk_auth_group_permissions_auth_group - FOREIGN KEY (group_id) REFERENCES auth_group (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_group_permissions_auth_permission ***************/ -ALTER TABLE auth_group_permissions ADD CONSTRAINT fk_auth_group_permissions_auth_permission - FOREIGN KEY (permission_id) REFERENCES auth_permission (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_message_auth_user ***************/ -ALTER TABLE auth_message ADD CONSTRAINT fk_auth_message_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_permission_django_content_type ***************/ -ALTER TABLE auth_permission ADD CONSTRAINT fk_auth_permission_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_user_groups_auth_group ***************/ -ALTER TABLE auth_user_groups ADD CONSTRAINT fk_auth_user_groups_auth_group - FOREIGN KEY (group_id) REFERENCES auth_group (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_user_groups_auth_user ***************/ -ALTER TABLE auth_user_groups ADD CONSTRAINT fk_auth_user_groups_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_user_user_permissions_auth_permission ***************/ -ALTER TABLE auth_user_user_permissions ADD CONSTRAINT fk_auth_user_user_permissions_auth_permission - FOREIGN KEY (permission_id) REFERENCES auth_permission (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_auth_user_user_permissions_auth_user ***************/ -ALTER TABLE auth_user_user_permissions ADD CONSTRAINT fk_auth_user_user_permissions_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_award_auth_user ***************/ -ALTER TABLE award ADD CONSTRAINT fk_award_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_award_badge ***************/ -ALTER TABLE award ADD CONSTRAINT fk_award_badge - FOREIGN KEY (badge_id) REFERENCES badge (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_books_auth_user ***************/ -ALTER TABLE book ADD CONSTRAINT fk_books_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_author_info_auth_user ***************/ -ALTER TABLE book_author_info ADD CONSTRAINT fk_book_author_info_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_author_info_book ***************/ -ALTER TABLE book_author_info ADD CONSTRAINT fk_book_author_info_book - FOREIGN KEY (book_id) REFERENCES book (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_author_rss_auth_user ***************/ -ALTER TABLE book_author_rss ADD CONSTRAINT fk_book_author_rss_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_author_rss_book ***************/ -ALTER TABLE book_author_rss ADD CONSTRAINT fk_book_author_rss_book - FOREIGN KEY (book_id) REFERENCES book (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_question_book ***************/ -ALTER TABLE book_question ADD CONSTRAINT fk_book_question_book - FOREIGN KEY (book_id) REFERENCES book (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_book_question_question ***************/ -ALTER TABLE book_question ADD CONSTRAINT fk_book_question_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_comment_auth_user ***************/ -ALTER TABLE `comment` ADD CONSTRAINT fk_comment_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_comment_django_content_type ***************/ -ALTER TABLE `comment` ADD CONSTRAINT fk_comment_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_django_admin_log_auth_user ***************/ -ALTER TABLE django_admin_log ADD CONSTRAINT fk_django_admin_log_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_django_admin_log_django_content_type ***************/ -ALTER TABLE django_admin_log ADD CONSTRAINT fk_django_admin_log_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_django_authopenid_userassociation_auth_user ***************/ -ALTER TABLE django_authopenid_userassociation ADD CONSTRAINT fk_django_authopenid_userassociation_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_django_authopenid_userpasswordqueue_auth_user ***************/ -ALTER TABLE django_authopenid_userpasswordqueue ADD CONSTRAINT fk_django_authopenid_userpasswordqueue_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_favorite_question_auth_user ***************/ -ALTER TABLE favorite_question ADD CONSTRAINT fk_favorite_question_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_favorite_question_question ***************/ -ALTER TABLE favorite_question ADD CONSTRAINT fk_favorite_question_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_flagged_item_auth_user ***************/ -ALTER TABLE flagged_item ADD CONSTRAINT fk_flagged_item_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_flagged_item_django_content_type ***************/ -ALTER TABLE flagged_item ADD CONSTRAINT fk_flagged_item_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: closed_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT closed_by_id_refs_id_56e9d00c - FOREIGN KEY (closed_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: deleted_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT deleted_by_id_refs_id_56e9d00c - FOREIGN KEY (deleted_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_auth_user ***************/ -ALTER TABLE question ADD CONSTRAINT fk_question_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: last_activity_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT last_activity_by_id_refs_id_56e9d00c - FOREIGN KEY (last_activity_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: last_edited_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT last_edited_by_id_refs_id_56e9d00c - FOREIGN KEY (last_edited_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: locked_by_id_refs_id_56e9d00c ***************/ -ALTER TABLE question ADD CONSTRAINT locked_by_id_refs_id_56e9d00c - FOREIGN KEY (locked_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_revision_auth_user ***************/ -ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_auth_user - FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_revision_question ***************/ -ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_tags_question ***************/ -ALTER TABLE question_tags ADD CONSTRAINT fk_question_tags_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_question_tags_tag ***************/ -ALTER TABLE question_tags ADD CONSTRAINT fk_question_tags_tag - FOREIGN KEY (tag_id) REFERENCES tag (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_repute_auth_user ***************/ -ALTER TABLE repute ADD CONSTRAINT fk_repute_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_repute_question ***************/ -ALTER TABLE repute ADD CONSTRAINT fk_repute_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_tag_auth_user ***************/ -ALTER TABLE tag ADD CONSTRAINT fk_tag_auth_user - FOREIGN KEY (created_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_user_badge_auth_user ***************/ -ALTER TABLE user_badge ADD CONSTRAINT fk_user_badge_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_user_badge_badge ***************/ -ALTER TABLE user_badge ADD CONSTRAINT fk_user_badge_badge - FOREIGN KEY (badge_id) REFERENCES badge (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_user_favorite_questions_auth_user ***************/ -ALTER TABLE user_favorite_questions ADD CONSTRAINT fk_user_favorite_questions_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_user_favorite_questions_question ***************/ -ALTER TABLE user_favorite_questions ADD CONSTRAINT fk_user_favorite_questions_question - FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_vote_auth_user ***************/ -ALTER TABLE vote ADD CONSTRAINT fk_vote_auth_user - FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; - -/************ Foreign Key: fk_vote_django_content_type ***************/ -ALTER TABLE vote ADD CONSTRAINT fk_vote_django_content_type - FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; \ No newline at end of file diff --git a/sql_scripts/update_2009_01_13_001.sql b/sql_scripts/update_2009_01_13_001.sql deleted file mode 100644 index 165d1125..00000000 --- a/sql_scripts/update_2009_01_13_001.sql +++ /dev/null @@ -1,62 +0,0 @@ --- phpMyAdmin SQL Dump --- version 3.0.0-beta --- http://www.phpmyadmin.net --- --- Host: localhost --- Generation Time: Jan 12, 2009 at 08:55 PM --- Server version: 5.0.67 --- PHP Version: 5.2.6 - -SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; - --- --- Database: `twogeekt_lanai` --- - --- --- Dumping data for table `badge` --- - -INSERT INTO `badge` (`id`, `name`, `type`, `slug`, `description`, `multiple`, `awarded_count`) VALUES -(1, '鐐肩嫳娉曞笀', 3, '鐐肩嫳娉曞笀', '鍒犻櫎鑷繁鏈3涓互涓婅禐鎴愮エ鐨勫笘瀛', 1, 0), -(2, '鍘嬪姏鐧介', 3, '鍘嬪姏鐧介', '鍒犻櫎鑷繁鏈3涓互涓婂弽瀵圭エ鐨勫笘瀛', 1, 0), -(3, '浼樼鍥炵瓟', 3, '浼樼鍥炵瓟', '鍥炵瓟濂借瘎10娆′互涓', 1, 0), -(4, '浼樼闂', 3, '浼樼闂', '闂濂借瘎10娆′互涓', 1, 0), -(5, '璇勮瀹', 3, '璇勮瀹', '璇勮10娆′互涓', 1, 0), -(6, '娴佽闂', 3, '娴佽闂', '闂鐨勬祻瑙堥噺瓒呰繃1000浜烘', 1, 0), -(7, '宸¢诲叺', 3, '宸¢诲叺', '绗竴娆℃爣璁板瀮鍦惧笘瀛', 1, 0), -(8, '娓呮磥宸', 3, '娓呮磥宸', '绗竴娆℃挙閿鎶曠エ', 1, 0), -(9, '鎵硅瘎瀹', 3, '鎵硅瘎瀹', '绗竴娆″弽瀵圭エ', 1, 0), -(10, '灏忕紪', 3, '灏忕紪', '绗竴娆$紪杈戞洿鏂', 1, 0), -(11, '鏉戦暱', 3, '鏉戦暱', '绗竴娆¢噸鏂版爣绛', 1, 0), -(12, '瀛﹁', 3, '瀛﹁', '绗竴娆℃爣璁扮瓟妗', 1, 0), -(13, '瀛︾敓', 3, '瀛︾敓', '绗竴娆℃彁闂苟涓旀湁涓娆′互涓婅禐鎴愮エ', 1, 0), -(14, '鏀寔鑰', 3, '鏀寔鑰', '绗竴娆¤禐鎴愮エ', 1, 0), -(15, '鏁欏笀', 3, '鏁欏笀', '绗竴娆″洖绛旈棶棰樺苟涓斿緱鍒颁竴涓互涓婅禐鎴愮エ', 1, 0), -(16, '鑷紶浣滆', 3, '鑷紶浣滆', '瀹屾暣濉啓鐢ㄦ埛璧勬枡鎵鏈夐夐」', 1, 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鐢ㄦ埛', '鍐呮祴鏈熼棿鐨勬椿璺冪敤鎴', 1, 0), -(23, '鏋佸ソ鍥炵瓟', 2, '鏋佸ソ鍥炵瓟', '鍥炵瓟瓒呰繃25娆¤禐鎴愮エ', 1, 0), -(24, '鏋佸ソ闂', 2, '鏋佸ソ闂', '闂瓒呰繃25娆¤禐鎴愮エ', 1, 0), -(25, '鍙楁杩庨棶棰', 2, '鍙楁杩庨棶棰', '闂琚25浜轰互涓婃敹钘', 1, 0), -(26, '浼樼甯傛皯', 2, '浼樼甯傛皯', '鎶曠エ300娆′互涓', 1, 0), -(27, '缂栬緫涓讳换', 2, '缂栬緫涓讳换', '缂栬緫浜100涓笘瀛', 1, 0), -(28, '閫氭墠', 2, '閫氭墠', '鍦ㄥ涓爣绛鹃鍩熸椿璺', 1, 0), -(29, '涓撳', 2, '涓撳', '鍦ㄤ竴涓爣绛鹃鍩熸椿璺冨嚭浼', 1, 0), -(30, '鑰侀笩', 2, '鑰侀笩', '娲昏穬瓒呰繃涓骞寸殑鐢ㄦ埛', 1, 0), -(31, '鏈鍙楀叧娉ㄩ棶棰', 2, '鏈鍙楀叧娉ㄩ棶棰', '闂鐨勬祻瑙堥噺瓒呰繃2500浜烘', 1, 0), -(32, '瀛﹂棶瀹', 2, '瀛﹂棶瀹', '绗竴娆″洖绛旇鎶曡禐鎴愮エ10娆′互涓', 1, 0), -(33, 'beta鐢ㄦ埛', 2, 'beta鐢ㄦ埛', 'beta鏈熼棿娲昏穬鍙備笌', 1, 0), -(34, '瀵煎笀', 2, '瀵煎笀', '琚寚瀹氫负鏈浣崇瓟妗堝苟涓旇禐鎴愮エ40浠ヤ笂', 1, 0), -(35, '宸笀', 2, '宸笀', '鍦ㄦ彁闂60澶╀箣鍚庡洖绛斿苟涓旇禐鎴愮エ5娆′互涓', 1, 0), -(36, '鍒嗙被涓撳', 2, '鍒嗙被涓撳', '鍒涘缓鐨勬爣绛捐50涓互涓婇棶棰樹娇鐢', 1, 0); diff --git a/sql_scripts/update_2009_01_13_002.sql b/sql_scripts/update_2009_01_13_002.sql deleted file mode 100644 index c223cb8c..00000000 --- a/sql_scripts/update_2009_01_13_002.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE activity ADD COLUMN is_auditted tinyint(1) DEFAULT 0 \ No newline at end of file diff --git a/sql_scripts/update_2009_01_18_001.sql b/sql_scripts/update_2009_01_18_001.sql deleted file mode 100644 index 6f29fa32..00000000 --- a/sql_scripts/update_2009_01_18_001.sql +++ /dev/null @@ -1,62 +0,0 @@ --- phpMyAdmin SQL Dump --- version 3.0.0-beta --- http://www.phpmyadmin.net --- --- Host: localhost --- Generation Time: Jan 12, 2009 at 08:55 PM --- Server version: 5.0.67 --- PHP Version: 5.2.6 - -SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; - - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; - --- --- Database: `twogeekt_lanai` --- - --- --- Dumping data for table `badge` --- - -INSERT INTO `badge` (`id`, `name`, `type`, `slug`, `description`, `multiple`, `awarded_count`) VALUES -(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); diff --git a/sql_scripts/update_2009_01_24.sql b/sql_scripts/update_2009_01_24.sql deleted file mode 100644 index 45b83935..00000000 --- a/sql_scripts/update_2009_01_24.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE award ADD COLUMN `content_type_id` int(11); -ALTER TABLE award ADD COLUMN `object_id` int(10); \ No newline at end of file diff --git a/sql_scripts/update_2009_01_25_001.sql b/sql_scripts/update_2009_01_25_001.sql deleted file mode 100644 index 1f1942e3..00000000 --- a/sql_scripts/update_2009_01_25_001.sql +++ /dev/null @@ -1,2 +0,0 @@ -锘緼LTER TABLE `award` ADD `content_type_id` INT NULL -ALTER TABLE `award` ADD `object_id` INT NULL \ No newline at end of file diff --git a/sql_scripts/update_2009_02_26_001.sql b/sql_scripts/update_2009_02_26_001.sql deleted file mode 100644 index 9cc80974..00000000 --- a/sql_scripts/update_2009_02_26_001.sql +++ /dev/null @@ -1,19 +0,0 @@ -锘緼LTER TABLE answer ADD COLUMN `accepted_at` datetime default null; - -/* Update accepted_at column with answer added datetime for existing data */ -UPDATE answer -SET accepted_at = added_at -WHERE accepted = 1 AND accepted_at IS NULL; - -/* workround for c# url problem on bluehost server */ -UPDATE tag -SET name = 'csharp' -WHERE name = 'c#' - -UPDATE question -SET tagnames = replace(tagnames, 'c#', 'csharp') -WHERE tagnames like '%c#%' - -UPDATE question_revision -SET tagnames = replace(tagnames, 'c#', 'csharp') -WHERE tagnames like '%c#%' \ No newline at end of file diff --git a/sql_scripts/update_2009_04_10_001.sql b/sql_scripts/update_2009_04_10_001.sql deleted file mode 100644 index b0d05ac7..00000000 --- a/sql_scripts/update_2009_04_10_001.sql +++ /dev/null @@ -1,3 +0,0 @@ -锘緼LTER TABLE Tag ADD COLUMN deleted_at datetime default null; -ALTER TABLE Tag ADD COLUMN deleted_by_id INTEGER NULL; -ALTER TABLE Tag ADD COLUMN deleted TINYINT NOT NULL; \ No newline at end of file diff --git a/sql_scripts/update_2009_12_24_001.sql b/sql_scripts/update_2009_12_24_001.sql deleted file mode 100644 index 3d082c2f..00000000 --- a/sql_scripts/update_2009_12_24_001.sql +++ /dev/null @@ -1,5 +0,0 @@ -alter table question add column `vote_up_count` int(11) NOT NULL; -alter table question add column `vote_down_count` int(11) NOT NULL; - -alter table answer add column `vote_up_count` int(11) NOT NULL; -alter table answer add column `vote_down_count` int(11) NOT NULL; \ No newline at end of file diff --git a/sql_scripts/update_2009_12_27_001.sql b/sql_scripts/update_2009_12_27_001.sql deleted file mode 100644 index e2da7d4d..00000000 --- a/sql_scripts/update_2009_12_27_001.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE comment DROP INDEX content_type_id; - -ALTER TABLE comment ADD INDEX `content_type_id` (`content_type_id`,`object_id`,`user_id`); \ No newline at end of file diff --git a/sql_scripts/update_2009_12_27_002.sql b/sql_scripts/update_2009_12_27_002.sql deleted file mode 100644 index a36470bf..00000000 --- a/sql_scripts/update_2009_12_27_002.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `vote` ADD `voted_at` DATETIME NOT NULL \ No newline at end of file diff --git a/templates/404.html b/templates/404.html deleted file mode 100644 index d24edaf0..00000000 --- a/templates/404.html +++ /dev/null @@ -1,49 +0,0 @@ - -{% extends "base_content.html" %} -{% load i18n %} -{% block title %}{% spaceless %}404 Error{% endspaceless %}{% endblock %} -{% block forestyle%} - -{% endblock %} -{% block forejs %} - -{% endblock %} -{% block content %} -
- 404 Not Found -
-
-
-

{% trans "Sorry, could not find the page you requested." %}

-
- {% trans "This might have happened for the following reasons:" %}
-
    -
  • {% trans "this question or answer has been deleted;" %}
  • -
  • {% trans "url has error - please check it;" %}
  • -
  • {% trans "the page you tried to visit is protected or you don't have sufficient points, see" %} faq
  • -
  • {% trans "if you believe this error 404 should not have occured, please" %} - {% trans "report this problem" %}
  • - -
- - -
- -
-{% endblock %} - diff --git a/templates/500.html b/templates/500.html deleted file mode 100644 index c99774b3..00000000 --- a/templates/500.html +++ /dev/null @@ -1,35 +0,0 @@ - -{% extends "base_content.html" %} -{% load i18n %} -{% block title %}{% spaceless %}500 Error{% endspaceless %}{% endblock %} -{% block forejs %} - -{% endblock %} -{% block content %} -
-

- 500 Server Error -

- -
-
-
-

{% trans "sorry, system error"

-
- {% trans "system error log is recorded, error will be fixed as soon as possible" %}
- {% trans "please report the error to the site administrators if you wish" %} -
- -
-{% endblock %} - diff --git a/templates/about.html b/templates/about.html deleted file mode 100644 index 4655a641..00000000 --- a/templates/about.html +++ /dev/null @@ -1,21 +0,0 @@ - -{% extends "base_content.html" %} -{% load i18n %} -{% load extra_tags %} -{% load humanize %} -{% block title %}{% spaceless %}{% trans "About" %}{% endspaceless %}{% endblock %} -{% block forejs %} -{% endblock %} -{% block content %} -
-{% trans "About" %} -
- -
-

edit file templates/about.html. Below are just suggestions of what can go here

-

what is your site for?

-

how does it work? what are roles of members?

-

is there a place to find out more about this website?

-
-{% endblock %} - diff --git a/templates/allfiles b/templates/allfiles deleted file mode 100644 index 3ca0191e..00000000 --- a/templates/allfiles +++ /dev/null @@ -1,30 +0,0 @@ -404.html -500.html -about.html -ask.html -badges.html -base_content.html -base.html -book.html -close.html -faq.html -footer.html -header.html -index.html -logout.html -pagesize.html -paginator.html -privacy.html -question_edit_tips.html -question.html -questions.html -revisions_answer.html -tags.html -unanswered.html -user_edit.html -user_info.html -users.html -users_questions.html -user_stats.html -user_tabs.html -user_votes.html diff --git a/templates/answer_edit.html b/templates/answer_edit.html deleted file mode 100644 index 008d9f78..00000000 --- a/templates/answer_edit.html +++ /dev/null @@ -1,88 +0,0 @@ - -{% extends "base.html" %} -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Edit answer" %}{% endspaceless %}{% endblock %} -{% block forejs %} - - - - - - - -{% endblock %} - -{% block content %} -
- {% trans "Edit answer" %} [{% trans "back" %}] -
-
-
-
-
- {% if revision_form.revision.errors %}{{ revision_form.revision.errors.as_ul }}{% endif %} -
- {{ revision_form.revision }} -

-
-
- {{ form.text }} - -
{% trans "toggle preview" %}
-
-
-
- - {{ form.summary.label_tag }}
- {{ form.summary }} {{ form.summary.errors }} -
- {{ form.summary.help_text }} -
-
- - -
-
-
-
-
-{% endblock %} - -{% block sidebar %} -{% include "answer_edit_tips.html" %} -{% endblock %} - -{% block endjs %} -{% endblock %} - diff --git a/templates/answer_edit_tips.html b/templates/answer_edit_tips.html deleted file mode 100644 index 08d33bc9..00000000 --- a/templates/answer_edit_tips.html +++ /dev/null @@ -1,54 +0,0 @@ - -{% load i18n %} -
-

{% trans "answer tips" %}

-
-
    -
  • {% trans "please make your answer relevant to this community" %} -
  • -
  • - {% trans "try to give an answer, rather than engage into a discussion" %} -
  • -
  • - {% trans "please try to provide details" %} -
  • -
  • - {% trans "be clear and concise" %} -
  • -
- faq 禄 -
-
-
- -
-

{% trans "Markdown tips" %}

-
    -
  • - {% trans "*italic* or __italic__" %} -
  • -
  • - {% trans "**bold** or __bold__" %} -
  • -
  • - {% trans "link" %}:[{% trans "text" %}](http://url.com/ "{% trans "title" %}") - -
  • - -
  • - {% trans "image" %}锛![alt {% trans "text" %}](/path/img.jpg "{% trans "title" %}") - -
  • -
  • - {% trans "numbered list:" %} - 1. Foo - 2. Bar -
  • -
  • - {% trans "basic HTML tags are also supported" %} -
  • -
- {% trans "learn more about Markdown" %} 禄 -
-
- diff --git a/templates/ask.html b/templates/ask.html deleted file mode 100644 index 1b00a701..00000000 --- a/templates/ask.html +++ /dev/null @@ -1,140 +0,0 @@ - -{% extends "base.html" %} -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Ask a question" %}{% endspaceless %}{% endblock %} -{% block forejs %} - - - - - - - -{% endblock %} - -{% block content %} -
- {% trans "Ask a question" %} -
-
-
-
-

-
- {{ form.title }} {{ form.title.errors }} -

- {{ form.title.help_text }} -
-

- -

-

- {{ form.text }} - -
- - - - - - -
- {% trans "toggle preview" %} - - {{ form.wiki }} {{ form.wiki.label_tag }} -
-
-
- -
-

-

- {{ form.tags.label_tag }}:
- {{ form.tags }} {{ form.tags.errors }} -

- {{ form.tags.help_text }} -
-

-
- {% if not request.user.is_authenticated %} - - - - - - -
- {% trans "Use" %} OpenID {% trans "Login" %}:
- {{ form.openid }} -
- {% trans "Get your own "%} OpenID銆 -
-
-
-
-
- {% trans "User name" %}:
- {{ form.user }} -

- {% trans "Email: (won't be shown to anyone)" %}:
- {{ form.email }} -

-
- {% endif %} - -

-
-
-
-{% endblock %} - -{% block sidebar %} -{% include "question_edit_tips.html" %} -{% endblock %} - -{% block endjs %} -{% endblock %} - diff --git a/templates/authopenid/changeemail.html b/templates/authopenid/changeemail.html deleted file mode 100644 index 99984b3f..00000000 --- a/templates/authopenid/changeemail.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "base_content.html" %} -{% load i18n %} -{% block content %} -
-

- {% trans "Account: change email" %} -

-
-

{% blocktrans %}This is where you can change the email address associated with your account. Please keep this email address up to date so we can send you a password-reset email if you request one.{% endblocktrans %}

-{% if form.errors %} -

{% trans "Please correct errors below:" %}
- {% if form.email.errors %} - {{ form.email.errors|join:", " }} - {% endif %} - {% if form.password.errors %} - {{ form.password.errors|join:", " }} - {% endif %} -

-{% endif %} - -{% if msg %} -

{{ msg }}

-{% endif %} - -
-
- -
{{ form.email }}
-
{{ form.password }}
- -

- -
-
-{% endblock %} diff --git a/templates/authopenid/changeopenid.html b/templates/authopenid/changeopenid.html deleted file mode 100644 index c1f3d180..00000000 --- a/templates/authopenid/changeopenid.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -
-

- {% trans "Account: change OpenID URL" %} -

-
- -

{% blocktrans %}This is where you can change your OpenID URL. Make sure you remember it!{% endblocktrans %}

-{% if form.errors %} -

{% trans "Please correct errors below:" %}
- {% if form.openid_url.errors %} - {{ form.openid_url.errors|join:", " }} - {% endif %} - - -

-{% endif %} -{% if msg %} -

{{ msg }}

-{% endif %} - -
-
- -
{{ form.openid_url }}
-

- -
-
-{% endblock %} diff --git a/templates/authopenid/changepw.html b/templates/authopenid/changepw.html deleted file mode 100644 index f3cf4be0..00000000 --- a/templates/authopenid/changepw.html +++ /dev/null @@ -1,33 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block head %} - -{% endblock %} - - - -{% block content %} -
-

- {% trans "Account: change password" %} -

-
-

{% blocktrans %}This is where you can change your password. Make sure you remember it!{% endblocktrans %}

-{% if form.errors %} -

{% trans "Please correct errors below:" %}
-{{ form.errors }} -

-{% endif %} - -
-
- -
{{ form.oldpw }}
-
{{ form.password1 }}
-
{{ form.password2 }}
-

- -
-
-{% endblock %} diff --git a/templates/authopenid/complete.html b/templates/authopenid/complete.html deleted file mode 100644 index 28c38a04..00000000 --- a/templates/authopenid/complete.html +++ /dev/null @@ -1,67 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% block head %}{% endblock %} -{% block title %}{% spaceless %}{% trans "Connect your OpenID with this site" %}{% endspaceless %}{% endblock %} -{% block content %} -
- {% trans "Connect your OpenID with your account on this site" %} -
-

-

{% trans "Your OpenID is accepted. Please complete this to finish registration." %}

-

{% trans "This account already exists, please use another." %}

-

- - {% if form1.errors %} -

- {% trans "Sorry, looks like we have some errors:" %}
-

    - {% if form1.username.errors %} -
  • {{ form1.username.errors|join:", " }}
  • - {% endif %} - {% if form1.email.errors %} -
  • {{ form1.email.errors|join:", " }}
  • - {% endif %} -
-

- {% endif %} - {% if form2.errors %} -

- {% trans "Sorry, looks like we have some errors:" %}
-

    - {% if form2.username.errors %} -
  • {{ form2.username.errors|join:", " }}
  • - {% endif %} - {% if form2.password.errors %} -
  • {{ form2.password.errors|join:", " }}
  • - {% endif %} -
-

- {% endif %} - - - -{% endblock %} diff --git a/templates/authopenid/confirm_email.txt b/templates/authopenid/confirm_email.txt deleted file mode 100644 index 9af177ed..00000000 --- a/templates/authopenid/confirm_email.txt +++ /dev/null @@ -1,12 +0,0 @@ -Thank you for registering. - -Your account details are: - -Username: {{ username }} -Password: {{ password }} - - -You may sign in here: -{{ site_url }}signin/ - - diff --git a/templates/authopenid/delete.html b/templates/authopenid/delete.html deleted file mode 100644 index 19e0884a..00000000 --- a/templates/authopenid/delete.html +++ /dev/null @@ -1,38 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - - -{% block content %} -
-

- {% trans "Account: delete account" %} -

-
- -

{% blocktrans %}Note: After deleting your account, anyone will be able to register this username.{% endblocktrans %}

-{% if form.errors %} -

{% trans "Please correct errors below:" %}
- {% if form.confirm.errors %} - {% trans "Check confirm box, if you want delete your account." %}
- {% endif %} - {% if form.password.errors %} - {% trans "Password:" %} {{ form.password.errors|join:", " }} - {% endif %} -

-{% endif %} -{% if msg %} -

{% trans "Please correct errors below:" %}
- {{ msg }} -

-{% endif %} -
-
- -
{{ form.confirm }} {% trans "I am sure I want to delete my account." %}
-
{{ form.password }} {% trans "(required for your security)" %}
- -

- -
-
-{% endblock %} diff --git a/templates/authopenid/failure.html b/templates/authopenid/failure.html deleted file mode 100644 index 87839ab2..00000000 --- a/templates/authopenid/failure.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - OpenID failed - - -

OpenID failed

- -

{{ message|escape }}

- - - \ No newline at end of file diff --git a/templates/authopenid/htmlfiles b/templates/authopenid/htmlfiles deleted file mode 100644 index 1b9dccd0..00000000 --- a/templates/authopenid/htmlfiles +++ /dev/null @@ -1,8 +0,0 @@ -changeemail.html -changeopenid.html -changepw.html -delete.html -failure.html -sendpw.html -settings.html -signup.html diff --git a/templates/authopenid/sendpw.html b/templates/authopenid/sendpw.html deleted file mode 100644 index a9488c4c..00000000 --- a/templates/authopenid/sendpw.html +++ /dev/null @@ -1,34 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Send new password" %}{% endspaceless %}{% endblock %} - -{% block content %} -
-

{% trans "Send new password" %}

- -
-
-{% trans "Lost your password? No problem - here you can reset it." %}
-{% trans "Please enter your username below and new password will be sent to your registered e-mail" %} -
-{% if form.errors %} -

{% "Sorry, looks like we have some errors:" %}
- {% if form.username.errors %} - {{ form.username.errors|join:", " }} - {% endif %} -

-{% endif %} -{% if msg %} -
{{ msg }}
-{% endif %} - -
-
-
{{ form.username }}
- -

{% trans "return to login" %}

- -
- {% trans "Note: your new password will be activated only after you click the activation link in the email message" %} -
-{% endblock %} diff --git a/templates/authopenid/sendpw_email.txt b/templates/authopenid/sendpw_email.txt deleted file mode 100644 index dec062a8..00000000 --- a/templates/authopenid/sendpw_email.txt +++ /dev/null @@ -1,14 +0,0 @@ -Someone has requested to reset your password on {{ site_url }}. -If this is not you, it is safe to ignore this email. - -Your new account details are: - -Username: {{ username }} -New password: {{ password }} - -To confirm reset of your password go to this address: -{{ site_url }}{{ url_confirm }}?key={{ confirm_key }} - -Regards, - - diff --git a/templates/authopenid/settings.html b/templates/authopenid/settings.html deleted file mode 100644 index ffd5dd8f..00000000 --- a/templates/authopenid/settings.html +++ /dev/null @@ -1,41 +0,0 @@ -{% extends "base_content.html" %} -{% load i18n %} - -{% block head %} - -{% endblock %} - -{% block content %} -
-

{{ request.user.username }} {% trans "Profile" %}

-
-
- {% if msg %} -

{{ msg }}

- {% endif %} - -
-
{% trans "Change password" %}
-
{% trans "Give your account a new password." %}
-
{% trans "Change email " %}
-
{% trans "Add or update the email address associated with your account." %}
- {% if is_openid %} -
{% trans "Change OpenID %}
-
{% trans "Change openid associated to your account" %}
- {% endif %} - -
{% trans "Delete account" %}
-
{% trans "Erase your username and all your data from website" %}
-
-
-{% endblock %} diff --git a/templates/authopenid/signin.html b/templates/authopenid/signin.html deleted file mode 100644 index aff2f06f..00000000 --- a/templates/authopenid/signin.html +++ /dev/null @@ -1,95 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} -{% block title %}{% spaceless %}{% trans "User login" %}{% endspaceless %}{% endblock %} -{% block forejs %} - - - -{% endblock %} -{% block content %} -
- {% trans "User login" %} -
- -{% endblock %} - -{% block sidebar %} -
-

{% trans "Why use OpenID?" %}

-

-

    -
  • - {% trans "with openid it is easier" %} -
  • -
  • - {% trans "reuse openid" %} -
  • -
  • - {% trans "openid is widely adopted" %} -
  • -
  • - {% trans "openid is supported open standard" %} -
  • - -
- {% trans "Find out more" %} 禄
- {% trans "Get OpenID" %} 禄 -

-
-
-{% endblock%} - diff --git a/templates/authopenid/signup.html b/templates/authopenid/signup.html deleted file mode 100644 index a4460aa3..00000000 --- a/templates/authopenid/signup.html +++ /dev/null @@ -1,52 +0,0 @@ -{% extends "base.html" %} -{% block title %}{% spaceless %}{% trans "Signup" %}{% endspaceless %}{% endblock %} - -{% block content %} -
-

{% trans "Signup" %}

- -
-
-

{% trans "We support two types of user registration: conventional username/password, and" %} {% trans "the OpenID method" %}.

- - {% if form.errors %} - -

- {% trans "Sorry, looks like we have some errors" %}
-

    - {% if form.username.errors %} -
  • {{ form.username.errors|join:", " }}
  • - {% endif %} - {% if form.email.errors %} -
  • {{ form.email.errors|join:", " }}
  • - {% endif %} - {% if form.password2.errors %} -
  • {{ form.password2.errors|join:", " }} -
  • - {% endif %} -
-

- {% endif %} -
-
-
- {% trans "Conventional registration" %} -

{{ form.username }}
- -

{{ form.email }}
-

{{ form.password1 }}
-

{{ form.password2 }}
- -
-
-
-
-
- -
-
{{ form2.openid_url }}
-
-
-
-{% endblock %} diff --git a/templates/authopenid/yadis.xrdf b/templates/authopenid/yadis.xrdf deleted file mode 100644 index a9ed44fe..00000000 --- a/templates/authopenid/yadis.xrdf +++ /dev/null @@ -1,14 +0,0 @@ - - - - - http://specs.openid.net/auth/2.0/return_to - {% for uri in return_to %} - {{ uri }} - {% endfor %} - - - \ No newline at end of file diff --git a/templates/badge.html b/templates/badge.html deleted file mode 100644 index d0906918..00000000 --- a/templates/badge.html +++ /dev/null @@ -1,37 +0,0 @@ - -{% extends "base_content.html" %} -{% load i18n %} -{% load extra_tags %} -{% load humanize %} -{% block title %}{% spaceless %}{{ badge.name }} - {% trans "Badge" %}{% endspaceless %}{% endblock %} -{% block forejs %} - -{% endblock %} -{% block content %} -
- {% trans "Badge" %} -
-
-

-  {{ badge.name }} {{ badge.description }} -

-
- {% if badge.awarded_count %} -

{{ awards|length|intcomma }} - {% trans "The users have been awarded with badges:" %}

- {% endif %} -
-
- {% for award in awards %} -

{{ award.name }} {% get_score_badge_by_details award.rep award.gold award.silver award.bronze %}

- {% endfor %} -
- -
-{% endblock %} - diff --git a/templates/badges.html b/templates/badges.html deleted file mode 100644 index 8a3b7eab..00000000 --- a/templates/badges.html +++ /dev/null @@ -1,78 +0,0 @@ - -{% extends "base.html" %} -{% load extra_tags %} -{% load humanize %} -{% load i18n %} -{% block title %}{% spaceless %}{% trans "Badges summary" %}{% endspaceless %}{% endblock %} -{% block forejs %} - -{% endblock %} -{% block content %} -
- {% trans "Badges" %} -
-
-

- {% trans "Community gives you awards for your questions, answers and votes." %}
- {% trans "Below is the list of available badges and number of times each type of badge has been awarded." %} -

-
-
- {% for badge in badges %} -
-
- {% for a in mybadges %} - {% ifequal a.badge_id badge.id %} - - {% endifequal %} - {% endfor %} -
-
-  {{ badge.name }} 脳 {{ badge.awarded_count|intcomma }} -
-

- {{ badge.description }} -

-
- {% endfor %} -
-
-{% endblock %} -{% block sidebar %} - -
-

{% trans "Community badges" %}

-
-

-  {% trans "gold" %} -

-

- {% trans "Gold badge is very rare." %} - {% trans "To obtain it you have to show profound knowledge and ability in addition to actively participating in the community." %} - {% trans "Gold badge is the highest award in this community." %} -

-

-  {% trans "silver" %} -

-

- {% trans "Obtaining silver badge requires significant patience." %} - {% trans "If you got one, you've very significantly contributed to this community" %} -

-

- -  {% trans "bronze" %} -

-

- {% trans "If you are active in this community, you will will get this medal - still it is a special honor." %} -

-
-
-{% endblock %} - diff --git a/templates/base.html b/templates/base.html deleted file mode 100644 index dca312e3..00000000 --- a/templates/base.html +++ /dev/null @@ -1,91 +0,0 @@ - - -{% load extra_filters %} -{% load i18n %} - - - {% block title %}{% endblock %} - {% trans "site title" %} - {% trans "site slogan" %} - {% spaceless %} - {% block meta %}{% endblock %} - {% endspaceless %} - - - - - - - - - - - - - {% with request.user.get_messages as messages%} - {% if messages %} - - - {% endif %} - {% endwith %} - - {% block forejs %} - {% endblock %} - - - - {% include "header.html" %} -
-
-
- {% block content%} - {% endblock%} - -
- -
- {% block sidebar%} - {% endblock%} - -
-
- {% block tail %} - {% endblock %} -
-
-
-
- {% include "footer.html" %} - {% block endjs %} - {% endblock %} - - - diff --git a/templates/base_content.html b/templates/base_content.html deleted file mode 100644 index 98a09150..00000000 --- a/templates/base_content.html +++ /dev/null @@ -1,86 +0,0 @@ - - -{% load i18n %} - - - {% block title %}{% endblock %} - {% trans "site title" %} - {% trans "site slogan" %} - - - - - {% spaceless %} - {% block forestyle %}{% endblock %} - {% endspaceless %} - - - - - - - - - - - {% with request.user.get_messages as messages%} - {% if messages %} - - - {% endif %} - {% endwith %} - - {% block forejs %} - {% endblock %} - - - - {% include "header.html" %} -
-
-
- {% block content%} - {% endblock%} - -
-
- {% block tail %} - {% endblock %} -
-
-
-
- {% include "footer.html" %} - {% block endjs %} - {% endblock %} - - - diff --git a/templates/book.html b/templates/book.html deleted file mode 100644 index a58a09f2..00000000 --- a/templates/book.html +++ /dev/null @@ -1,152 +0,0 @@ - -{% extends "base_content.html" %} -{% load i18n %} -{% load extra_tags %} -{% load extra_filters %} -{% load humanize %} -{% block title %}{% spaceless %}{{ book.title }}-{% trans "reading channel" %}{% endspaceless %}{% endblock %} -{% block forejs %} - -{% endblock %} -{% block content %} - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% if author_info.blog_url %} - - - - - - {% endif %} - - - - - - - - -
{% trans "[author]" %}{{ book.author }}
{% trans "[publisher]" %}{{ book.publication }}
{% trans "[publication date]" %}{{ book.published_at|date:"Y-m" }}
{% trans "[price]" %}{{ book.price }} {% trans "currency unit" %}
{% trans "[pages]" %}{{ book.pages }} {% trans "pages abbreviation" %}
{% trans "[tags]" %}{{ book.tagnames }}
 
{% trans "author blog" %} 禄
{% trans "book directory" %} 禄
{% trans "buy online" %} 禄
-
-
- -
-
- - -{% endblock %} -{% block tail %} -
- {% cnprog_paginator context %} - -
- - -{% endblock %} - diff --git a/templates/close.html b/templates/close.html deleted file mode 100644 index 32df3e82..00000000 --- a/templates/close.html +++ /dev/null @@ -1,36 +0,0 @@ - -{% extends "base_content.html" %} -{% load i18n %} -{% load extra_tags %} -{% load humanize %} -{% block title %}{% spaceless %}{% trans "Close question" %}{% endspaceless %}{% endblock %} -{% block forejs %} - -{% endblock %} -{% block content %} -
- {% trans "Close question" %} -
-
-

{% trans "Close the question" %}: - {{ question.get_question_title }} -

- -
-

- {% trans "Reasons" %}: {{ form.reason }} -

-
- - - -
- -
-
-{% endblock %} - diff --git a/templates/content/images/box-arrow.gif b/templates/content/images/box-arrow.gif deleted file mode 100644 index 89dcf5b3..00000000 Binary files a/templates/content/images/box-arrow.gif and /dev/null differ diff --git a/templates/content/images/bullet_green.gif b/templates/content/images/bullet_green.gif deleted file mode 100644 index fa530910..00000000 Binary files a/templates/content/images/bullet_green.gif and /dev/null differ diff --git a/templates/content/images/cc-88x31.png b/templates/content/images/cc-88x31.png deleted file mode 100644 index 0f2a0f10..00000000 Binary files a/templates/content/images/cc-88x31.png and /dev/null differ diff --git a/templates/content/images/cc-wiki.png b/templates/content/images/cc-wiki.png deleted file mode 100644 index 3e680538..00000000 Binary files a/templates/content/images/cc-wiki.png and /dev/null differ diff --git a/templates/content/images/close-small-hover.png b/templates/content/images/close-small-hover.png deleted file mode 100644 index 7899aec7..00000000 Binary files a/templates/content/images/close-small-hover.png and /dev/null differ diff --git a/templates/content/images/close-small.png b/templates/content/images/close-small.png deleted file mode 100644 index 5a99d31f..00000000 Binary files a/templates/content/images/close-small.png and /dev/null differ diff --git a/templates/content/images/cnprog_logo_200_56.gif b/templates/content/images/cnprog_logo_200_56.gif deleted file mode 100644 index ab690de2..00000000 Binary files a/templates/content/images/cnprog_logo_200_56.gif and /dev/null differ diff --git a/templates/content/images/dash.gif b/templates/content/images/dash.gif deleted file mode 100644 index d1ddc507..00000000 Binary files a/templates/content/images/dash.gif and /dev/null differ diff --git a/templates/content/images/djangomade124x25_grey.gif b/templates/content/images/djangomade124x25_grey.gif deleted file mode 100644 index d34bb311..00000000 Binary files a/templates/content/images/djangomade124x25_grey.gif and /dev/null differ diff --git a/templates/content/images/dot-g.gif b/templates/content/images/dot-g.gif deleted file mode 100644 index 5d6bb28e..00000000 Binary files a/templates/content/images/dot-g.gif and /dev/null differ diff --git a/templates/content/images/dot-list.gif b/templates/content/images/dot-list.gif deleted file mode 100644 index f6a6b865..00000000 Binary files a/templates/content/images/dot-list.gif and /dev/null differ diff --git a/templates/content/images/edit.png b/templates/content/images/edit.png deleted file mode 100644 index dcb09be0..00000000 Binary files a/templates/content/images/edit.png and /dev/null differ diff --git a/templates/content/images/expander-arrow-hide.gif b/templates/content/images/expander-arrow-hide.gif deleted file mode 100644 index feb6a618..00000000 Binary files a/templates/content/images/expander-arrow-hide.gif and /dev/null differ diff --git a/templates/content/images/expander-arrow-show.gif b/templates/content/images/expander-arrow-show.gif deleted file mode 100644 index 6825c56e..00000000 Binary files a/templates/content/images/expander-arrow-show.gif and /dev/null differ diff --git a/templates/content/images/favicon.gif b/templates/content/images/favicon.gif deleted file mode 100644 index 910c2666..00000000 Binary files a/templates/content/images/favicon.gif and /dev/null differ diff --git a/templates/content/images/favicon.ico b/templates/content/images/favicon.ico deleted file mode 100644 index b5c6f578..00000000 Binary files a/templates/content/images/favicon.ico and /dev/null differ diff --git a/templates/content/images/feed-icon-small.png b/templates/content/images/feed-icon-small.png deleted file mode 100644 index b3c949d2..00000000 Binary files a/templates/content/images/feed-icon-small.png and /dev/null differ diff --git a/templates/content/images/grippie.png b/templates/content/images/grippie.png deleted file mode 100644 index 6524d416..00000000 Binary files a/templates/content/images/grippie.png and /dev/null differ diff --git a/templates/content/images/indicator.gif b/templates/content/images/indicator.gif deleted file mode 100644 index 1c72ebb5..00000000 Binary files a/templates/content/images/indicator.gif and /dev/null differ diff --git a/templates/content/images/logo.png b/templates/content/images/logo.png deleted file mode 100644 index 640eb1da..00000000 Binary files a/templates/content/images/logo.png and /dev/null differ diff --git a/templates/content/images/logo1.png b/templates/content/images/logo1.png deleted file mode 100644 index d79a6271..00000000 Binary files a/templates/content/images/logo1.png and /dev/null differ diff --git a/templates/content/images/logo2.png b/templates/content/images/logo2.png deleted file mode 100644 index bd3cccd9..00000000 Binary files a/templates/content/images/logo2.png and /dev/null differ diff --git a/templates/content/images/medala.gif b/templates/content/images/medala.gif deleted file mode 100644 index 93dd1a39..00000000 Binary files a/templates/content/images/medala.gif and /dev/null differ diff --git a/templates/content/images/medala_on.gif b/templates/content/images/medala_on.gif deleted file mode 100644 index a18f9e85..00000000 Binary files a/templates/content/images/medala_on.gif and /dev/null differ diff --git a/templates/content/images/new.gif b/templates/content/images/new.gif deleted file mode 100644 index 8a220b53..00000000 Binary files a/templates/content/images/new.gif and /dev/null differ diff --git a/templates/content/images/nophoto.png b/templates/content/images/nophoto.png deleted file mode 100644 index 2daf0ffd..00000000 Binary files a/templates/content/images/nophoto.png and /dev/null differ diff --git a/templates/content/images/openid.gif b/templates/content/images/openid.gif deleted file mode 100644 index 8540e12b..00000000 Binary files a/templates/content/images/openid.gif and /dev/null differ diff --git a/templates/content/images/openid/aol.gif b/templates/content/images/openid/aol.gif deleted file mode 100644 index decc4f12..00000000 Binary files a/templates/content/images/openid/aol.gif and /dev/null differ diff --git a/templates/content/images/openid/blogger.ico b/templates/content/images/openid/blogger.ico deleted file mode 100644 index 1b9730b0..00000000 Binary files a/templates/content/images/openid/blogger.ico and /dev/null differ diff --git a/templates/content/images/openid/claimid.ico b/templates/content/images/openid/claimid.ico deleted file mode 100644 index 2b80f491..00000000 Binary files a/templates/content/images/openid/claimid.ico and /dev/null differ diff --git a/templates/content/images/openid/facebook.gif b/templates/content/images/openid/facebook.gif deleted file mode 100644 index b997b358..00000000 Binary files a/templates/content/images/openid/facebook.gif and /dev/null differ diff --git a/templates/content/images/openid/flickr.ico b/templates/content/images/openid/flickr.ico deleted file mode 100644 index 11f6e07f..00000000 Binary files a/templates/content/images/openid/flickr.ico and /dev/null differ diff --git a/templates/content/images/openid/google.gif b/templates/content/images/openid/google.gif deleted file mode 100644 index 1b6cd07b..00000000 Binary files a/templates/content/images/openid/google.gif and /dev/null differ diff --git a/templates/content/images/openid/livejournal.ico b/templates/content/images/openid/livejournal.ico deleted file mode 100644 index f3d21ec5..00000000 Binary files a/templates/content/images/openid/livejournal.ico and /dev/null differ diff --git a/templates/content/images/openid/myopenid.ico b/templates/content/images/openid/myopenid.ico deleted file mode 100644 index ceb06e6a..00000000 Binary files a/templates/content/images/openid/myopenid.ico and /dev/null differ diff --git a/templates/content/images/openid/openid-inputicon.gif b/templates/content/images/openid/openid-inputicon.gif deleted file mode 100644 index cde836c8..00000000 Binary files a/templates/content/images/openid/openid-inputicon.gif and /dev/null differ diff --git a/templates/content/images/openid/openid.gif b/templates/content/images/openid/openid.gif deleted file mode 100644 index c718b0e6..00000000 Binary files a/templates/content/images/openid/openid.gif and /dev/null differ diff --git a/templates/content/images/openid/technorati.ico b/templates/content/images/openid/technorati.ico deleted file mode 100644 index fa1083c1..00000000 Binary files a/templates/content/images/openid/technorati.ico and /dev/null differ diff --git a/templates/content/images/openid/verisign.ico b/templates/content/images/openid/verisign.ico deleted file mode 100644 index 3953af93..00000000 Binary files a/templates/content/images/openid/verisign.ico and /dev/null differ diff --git a/templates/content/images/openid/vidoop.ico b/templates/content/images/openid/vidoop.ico deleted file mode 100644 index bbd9a0d5..00000000 Binary files a/templates/content/images/openid/vidoop.ico and /dev/null differ diff --git a/templates/content/images/openid/wordpress.ico b/templates/content/images/openid/wordpress.ico deleted file mode 100644 index 31b7d2c2..00000000 Binary files a/templates/content/images/openid/wordpress.ico and /dev/null differ diff --git a/templates/content/images/openid/yahoo.gif b/templates/content/images/openid/yahoo.gif deleted file mode 100644 index 42adbfa5..00000000 Binary files a/templates/content/images/openid/yahoo.gif and /dev/null differ diff --git a/templates/content/images/quest-bg.gif b/templates/content/images/quest-bg.gif deleted file mode 100644 index b7540238..00000000 Binary files a/templates/content/images/quest-bg.gif and /dev/null differ diff --git a/templates/content/images/vote-accepted-on.png b/templates/content/images/vote-accepted-on.png deleted file mode 100644 index 2026f3bc..00000000 Binary files a/templates/content/images/vote-accepted-on.png and /dev/null differ diff --git a/templates/content/images/vote-accepted.png b/templates/content/images/vote-accepted.png deleted file mode 100644 index ecd18551..00000000 Binary files a/templates/content/images/vote-accepted.png and /dev/null differ diff --git a/templates/content/images/vote-arrow-down-on.png b/templates/content/images/vote-arrow-down-on.png deleted file mode 100644 index 048dbb44..00000000 Binary files a/templates/content/images/vote-arrow-down-on.png and /dev/null differ diff --git a/templates/content/images/vote-arrow-down.png b/templates/content/images/vote-arrow-down.png deleted file mode 100644 index e4fdec0a..00000000 Binary files a/templates/content/images/vote-arrow-down.png and /dev/null differ diff --git a/templates/content/images/vote-arrow-up-on.png b/templates/content/images/vote-arrow-up-on.png deleted file mode 100644 index 56ad0c25..00000000 Binary files a/templates/content/images/vote-arrow-up-on.png and /dev/null differ diff --git a/templates/content/images/vote-arrow-up.png b/templates/content/images/vote-arrow-up.png deleted file mode 100644 index 6e9a51c7..00000000 Binary files a/templates/content/images/vote-arrow-up.png and /dev/null differ diff --git a/templates/content/images/vote-favorite-off.png b/templates/content/images/vote-favorite-off.png deleted file mode 100644 index c1bef074..00000000 Binary files a/templates/content/images/vote-favorite-off.png and /dev/null differ diff --git a/templates/content/images/vote-favorite-on.png b/templates/content/images/vote-favorite-on.png deleted file mode 100644 index 1f9c14ab..00000000 Binary files a/templates/content/images/vote-favorite-on.png and /dev/null differ diff --git a/templates/content/js/com.cnprog.editor.js b/templates/content/js/com.cnprog.editor.js deleted file mode 100644 index 289d9866..00000000 --- a/templates/content/js/com.cnprog.editor.js +++ /dev/null @@ -1,68 +0,0 @@ -锘/* - jQuery TextAreaResizer plugin - Created on 17th January 2008 by Ryan O'Dell - Version 1.0.4 -*/(function($){var textarea,staticOffset;var iLastMousePos=0;var iMin=32;var grip;$.fn.TextAreaResizer=function(){return this.each(function(){textarea=$(this).addClass('processed'),staticOffset=null;$(this).wrap('
').parent().append($('
').bind("mousedown",{el:this},startDrag));var grippie=$('div.grippie',$(this).parent())[0];grippie.style.marginRight=(grippie.offsetWidth-$(this)[0].offsetWidth)+'px'})};function startDrag(e){textarea=$(e.data.el);textarea.blur();iLastMousePos=mousePosition(e).y;staticOffset=textarea.height()-iLastMousePos;textarea.css('opacity',0.25);$(document).mousemove(performDrag).mouseup(endDrag);return false}function performDrag(e){var iThisMousePos=mousePosition(e).y;var iMousePos=staticOffset+iThisMousePos;if(iLastMousePos>=(iThisMousePos)){iMousePos-=5}iLastMousePos=iThisMousePos;iMousePos=Math.max(iMin,iMousePos);textarea.height(iMousePos+'px');if(iMousePos1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&¤tValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))result[i]=$.trim(value);});return result;}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else -$input.val("");}});}if(wasVisible)$.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"$1");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else -if(data[q]){return data[q];}else -if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("
").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("
    ").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}field.focus();};})(jQuery); -/* - * TypeWatch 2.0 - Original by Denny Ferrassoli / Refactored by Charles Christolini - * Copyright(c) 2007 Denny Ferrassoli - DennyDotNet.com - * Coprright(c) 2008 Charles Christolini - BinaryPie.com - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html -*/(function(jQuery){jQuery.fn.typeWatch=function(o){var options=jQuery.extend({wait:750,callback:function(){},highlight:true,captureLength:2},o);function checkElement(timer,override){var elTxt=jQuery(timer.el).val();if((elTxt.length>options.captureLength&&elTxt.toUpperCase()!=timer.text)||(override&&elTxt.length>options.captureLength)){timer.text=elTxt.toUpperCase();timer.cb(elTxt)}};function watchElement(elem){if(elem.type.toUpperCase()=="TEXT"||elem.nodeName.toUpperCase()=="TEXTAREA"){var timer={timer:null,text:jQuery(elem).val().toUpperCase(),cb:options.callback,el:elem,wait:options.wait};if(options.highlight){jQuery(elem).focus(function(){this.select()})}var startWatch=function(evt){var timerWait=timer.wait;var overrideBool=false;if(evt.keyCode==13&&this.type.toUpperCase()=="TEXT"){timerWait=1;overrideBool=true}var timerCallbackFx=function(){checkElement(timer,overrideBool)};clearTimeout(timer.timer);timer.timer=setTimeout(timerCallbackFx,timerWait)};jQuery(elem).keydown(startWatch)}};return this.each(function(index){watchElement(this)})}})(jQuery); -/* -Ajax upload -*/jQuery.extend({createUploadIframe:function(d,b){var a="jUploadFrame"+d;if(window.ActiveXObject){var c=document.createElement('