diff -ruN CNPROG/context.py mikes/context.py
--- CNPROG/context.py 1969-12-31 19:00:00.000000000 -0500
+++ mikes/context.py 2009-07-25 19:09:58.098151134 -0400
@@ -0,0 +1,9 @@
+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 -ruN CNPROG/development.log mikes/development.log
--- CNPROG/development.log 1969-12-31 19:00:00.000000000 -0500
+++ mikes/development.log 2009-07-25 19:09:58.098151134 -0400
@@ -0,0 +1 @@
+# development log
\ No newline at end of file
diff -ruN CNPROG/django_authopenid/models.py mikes/django_authopenid/models.py
--- CNPROG/django_authopenid/models.py 2009-06-22 21:42:50.000000000 -0400
+++ mikes/django_authopenid/models.py 2009-07-25 19:09:58.098151134 -0400
@@ -3,7 +3,7 @@
from django.contrib.auth.models import User
from django.db import models
-import md5, random, sys, os, time
+import hashlib, random, sys, os, time
__all__ = ['Nonce', 'Association', 'UserAssociation',
'UserPasswordQueueManager', 'UserPasswordQueue']
@@ -47,7 +47,7 @@
# 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" % (
+ confirm_key = hashlib.md5("%s%s%s%s" % (
random.randint(0, sys.maxint - 1), os.getpid(),
time.time(), settings.SECRET_KEY)).hexdigest()
try:
diff -ruN CNPROG/django_authopenid/util.py mikes/django_authopenid/util.py
--- CNPROG/django_authopenid/util.py 2009-06-22 21:42:50.000000000 -0400
+++ mikes/django_authopenid/util.py 2009-07-25 19:09:58.098151134 -0400
@@ -15,7 +15,7 @@
except:
from yadis import xri
-import time, base64, md5, operator
+import time, base64, hashlib, operator
import urllib
from models import Association, Nonce
@@ -128,7 +128,7 @@
def getAuthKey(self):
# Use first AUTH_KEY_LEN characters of md5 hash of SECRET_KEY
- return md5.new(settings.SECRET_KEY).hexdigest()[:self.AUTH_KEY_LEN]
+ return hashlib.md5(settings.SECRET_KEY).hexdigest()[:self.AUTH_KEY_LEN]
def isDumb(self):
return False
diff -ruN CNPROG/forum/const.py mikes/forum/const.py
--- CNPROG/forum/const.py 2009-07-26 16:01:31.559063617 -0400
+++ mikes/forum/const.py 2009-07-25 19:09:58.098151134 -0400
@@ -53,22 +52,24 @@
#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_ACTIVITY_EDIT_QUESTION, u'编辑问题'),
+ #(TYPE_ACTIVITY_EDIT_ANSWER, u'编辑答案'),
)
diff -ruN CNPROG/forum/management/commands/once_award_badges.py mikes/forum/management/commands/once_award_badges.py
--- CNPROG/forum/management/commands/once_award_badges.py 2009-06-22 21:42:50.000000000 -0400
+++ mikes/forum/management/commands/once_award_badges.py 2009-07-25 19:09:58.098151134 -0400
@@ -157,7 +157,8 @@
"""
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
+ 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:
@@ -205,7 +206,10 @@
(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)
+ 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)
@@ -232,7 +236,10 @@
(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)
+ 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)
@@ -257,7 +264,11 @@
"""
(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)
+ 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)
@@ -281,7 +292,11 @@
"""
(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)
+ 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)
@@ -289,7 +304,11 @@
"""
(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)
+ 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)
@@ -297,7 +316,11 @@
"""
(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)
+ 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):
diff -ruN CNPROG/forum/managers.py mikes/forum/managers.py
--- CNPROG/forum/managers.py 2009-06-22 21:42:50.000000000 -0400
+++ mikes/forum/managers.py 2009-07-25 19:09:58.098151134 -0400
@@ -4,8 +4,29 @@
from django.db import connection, models, transaction
from django.db.models import Q
from forum.models import *
+from urllib import quote, unquote
class QuestionManager(models.Manager):
+ def get_translation_questions(self, orderby, page_size):
+ questions = self.filter(deleted=False, author__id__in=[28,29]).order_by(orderby)[:page_size]
+ return questions
+
+ def get_questions_by_pagesize(self, orderby, page_size):
+ questions = self.filter(deleted=False).order_by(orderby)[:page_size]
+ return questions
+
+ def get_questions_by_tag(self, tagname, orderby):
+ questions = self.filter(deleted=False, tags__name = unquote(tagname)).order_by(orderby)
+ return questions
+
+ def get_unanswered_questions(self, orderby):
+ questions = self.filter(deleted=False, answer_count=0).order_by(orderby)
+ return questions
+
+ def get_questions(self, orderby):
+ questions = self.filter(deleted=False).order_by(orderby)
+ return questions
+
def update_tags(self, question, tagnames, user):
"""
Updates Tag associations for a question to match the given
@@ -92,7 +113,12 @@
'WHERE tag_id = tag.id'
') '
'WHERE id IN (%s)')
-
+
+ def get_valid_tags(self, page_size):
+ from forum.models import Tag
+ tags = Tag.objects.all().filter(deleted=False).exclude(used_count=0).order_by("-id")[:page_size]
+ return tags
+
def get_or_create_multiple(self, names, user):
"""
Fetches a list of Tags with the given names, creating any Tags
@@ -123,6 +149,19 @@
query = self.UPDATE_USED_COUNTS_QUERY % ','.join(['%s'] * len(tags))
cursor.execute(query, [tag.id for tag in tags])
transaction.commit_unless_managed()
+
+ def get_tags_by_questions(self, questions):
+ question_ids = []
+ for question in questions:
+ question_ids.append(question.id)
+
+ question_ids_str = ','.join([str(id) for id in question_ids])
+ related_tags = self.extra(
+ tables=['tag', 'question_tags'],
+ where=["tag.id = question_tags.tag_id AND question_tags.question_id IN (" + question_ids_str + ")"]
+ ).distinct()
+
+ return related_tags
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'
@@ -205,4 +244,16 @@
return row[0]
else:
- return 0
\ No newline at end of file
+ return 0
+class AwardManager(models.Manager):
+ def get_recent_awards(self):
+ awards = super(AwardManager, self).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')
+ return awards
diff -ruN CNPROG/forum/models.py mikes/forum/models.py
--- CNPROG/forum/models.py 2009-06-22 21:42:50.000000000 -0400
+++ mikes/forum/models.py 2009-07-25 19:09:58.108151006 -0400
@@ -351,7 +350,8 @@
content_object = generic.GenericForeignKey('content_type', 'object_id')
awarded_at = models.DateTimeField(default=datetime.datetime.now)
notified = models.BooleanField(default=False)
-
+ objects = AwardManager()
+
def __unicode__(self):
return u'[%s] is awarded a badge [%s] at %s' % (self.user.username, self.badge.name, self.awarded_at)
diff -ruN CNPROG/forum/templatetags/extra_tags.py mikes/forum/templatetags/extra_tags.py
--- CNPROG/forum/templatetags/extra_tags.py 2009-06-22 21:42:50.000000000 -0400
+++ mikes/forum/templatetags/extra_tags.py 2009-07-25 19:09:58.108151006 -0400
@@ -1,4 +1,4 @@
-import time
+import time
import datetime
import math
import re
@@ -50,10 +49,10 @@
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
+NUM_PAGES_OUTSIDE_RANGE = 1
ADJACENT_PAGES = 2
@register.inclusion_tag("paginator.html")
def cnprog_paginator(context):
@@ -65,10 +64,10 @@
" 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"]]
+ 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"]]
@@ -77,11 +76,11 @@
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:
+ 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"],
@@ -205,12 +197,12 @@
m = re.match(pattern, strValue)
return first + result
-@register.simple_tag
+@register.simple_tag
def convert2tagname_list(question):
question['tagnames'] = [name for name in question['tagnames'].split(u' ')]
return ''
-@register.simple_tag
+@register.simple_tag
def diff_date(date, limen=2):
current_time = datetime.datetime(*time.localtime()[0:6])
diff = current_time - date
@@ -237,4 +229,4 @@
timestr = strftime("%H:%M %b-%d-%Y %Z", localtime(latest))
except:
timestr = ''
- return timestr
+ return timestr
\ No newline at end of file
diff -ruN CNPROG/forum/user.py mikes/forum/user.py
--- CNPROG/forum/user.py 2009-06-22 21:42:50.000000000 -0400
+++ mikes/forum/user.py 2009-07-25 19:09:58.108151006 -0400
@@ -1,3 +1,4 @@
+# coding=utf-8
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):
diff -ruN CNPROG/forum/views.py mikes/forum/views.py
--- CNPROG/forum/views.py 2009-06-22 21:42:50.000000000 -0400
+++ mikes/forum/views.py 2009-07-25 19:09:58.108151006 -0400
@@ -77,29 +76,17 @@
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]
+ questions = Question.objects.get_translation_questions(orderby, INDEX_PAGE_SIZE)
else:
- questions = Question.objects.filter(deleted=False).order_by(orderby)[:INDEX_PAGE_SIZE]
+ questions = Question.objects.get_questions_by_pagesize(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]
+ questions = questions.select_related()
+ tags = Tag.objects.get_valid_tags(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'
+ awards = Award.objects.get_recent_awards()
return render_to_response('index.html', {
"questions" : questions,
- 'testvar':testvar,
"tab_id" : view_id,
"tags" : tags,
"awards" : awards[:INDEX_AWARD_SIZE],
@@ -127,29 +114,11 @@
# 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
-
+ pagesize = request.session.get("pagesize")
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" }
@@ -161,29 +130,24 @@
# 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()
+ objects = Question.objects.get_questions_by_tag(tagname, orderby)
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)
+ objects = Question.objects.get_unanswered_questions(orderby)
else:
- objects = Question.objects.filter(deleted=False).order_by(orderby)
+ objects = Question.objects.get_questions(orderby)
# RISK - inner join queries
- objects = objects.select_related();
+ objects = objects.select_related(depth=1);
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)
-
+ if questions.object_list.count() > 0:
+ related_tags = Tag.objects.get_tags_by_questions(questions.object_list)
+ else:
+ related_tags = None
return render_to_response(template_file, {
"questions" : questions,
"tab_id" : view_id,
@@ -1022,6 +986,7 @@
'title',
'author_id',
'accepted',
+ 'vote_count',
'answer_count',
'vote_up_count',
'vote_down_count')[:100]
@@ -1090,7 +1055,8 @@
'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'],
+ 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(
@@ -1114,8 +1080,8 @@
'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'],
+ 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(
@@ -1140,7 +1106,9 @@
},
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'],
+ 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(
@@ -1166,7 +1134,10 @@
},
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'],
+ 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(
@@ -1192,7 +1163,9 @@
'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'],
+ 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(
@@ -1220,7 +1193,10 @@
},
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'],
+ 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(
@@ -1246,7 +1222,9 @@
'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'],
+ 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(
@@ -1267,7 +1245,8 @@
'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'],
+ 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(
@@ -1320,7 +1299,8 @@
},
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'],
+ 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(
@@ -1349,7 +1329,8 @@
'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'],
+ 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(
@@ -1378,7 +1359,9 @@
'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'],
+ 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(
@@ -1409,7 +1392,8 @@
},
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'],
+ 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(
@@ -1453,7 +1437,8 @@
},
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'],
+ 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(
@@ -1476,7 +1461,8 @@
},
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'],
+ 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(
@@ -1501,7 +1487,8 @@
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'},
+ 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'],
@@ -1510,6 +1497,7 @@
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)
@@ -1531,7 +1519,8 @@
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',
+ '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',
@@ -1541,7 +1530,8 @@
},
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'],
+ 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',
@@ -1672,7 +1662,12 @@
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'},
+ 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]
diff -ruN CNPROG/INSTALL mikes/INSTALL
--- CNPROG/INSTALL 1969-12-31 19:00:00.000000000 -0500
+++ mikes/INSTALL 2009-07-25 19:09:58.068150962 -0400
@@ -0,0 +1,33 @@
+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 -ruN CNPROG/junk mikes/junk
--- CNPROG/junk 2009-06-22 21:42:52.000000000 -0400
+++ mikes/junk 1969-12-31 19:00:00.000000000 -0500
@@ -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 -ruN CNPROG/lanai.psproj mikes/lanai.psproj
--- CNPROG/lanai.psproj 2009-06-22 21:42:52.000000000 -0400
+++ mikes/lanai.psproj 1969-12-31 19:00:00.000000000 -0500
@@ -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 -ruN CNPROG/LICENSE mikes/LICENSE
--- CNPROG/LICENSE 2009-06-22 21:42:52.000000000 -0400
+++ mikes/LICENSE 2009-07-25 19:09:58.088150984 -0400
@@ -1,12 +1,14 @@
-Ȩ(c) 2008 CNProg.com
+Copyright (C) 2009. Chen Gang
-2.0汾Apache֤("֤")Ȩ
-ݱ֤ûԲʹôļ
-ûɴַ֤
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
-http://www.apache.org/licenses/LICENSE-2.0
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
-÷Ҫͬ⣬
-ַ֤ǻ"ԭ"ṩ
-κʾĻʾı֤
-֤£ضԵĹϽȨơ
\ No newline at end of file
+You should have received a copy of the GNU General Public License
+along with this program. If not, see .
diff -ruN CNPROG/locale/zh_CN/LC_MESSAGES/django.po mikes/locale/zh_CN/LC_MESSAGES/django.po
--- CNPROG/locale/zh_CN/LC_MESSAGES/django.po 1969-12-31 19:00:00.000000000 -0500
+++ mikes/locale/zh_CN/LC_MESSAGES/django.po 2009-07-25 19:09:58.108151006 -0400
@@ -0,0 +1,629 @@
+# 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-15 13:53+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 "用户名不正确"
+
+#: 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 "该OpenID %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 templates/questions.html:45
+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 templates/questions.html:25
+msgid "Newest updated questions"
+msgstr "最新更新的问题"
+
+#: templates/index.html:23 templates/questions.html:24
+msgid "Newest"
+msgstr "最新问题"
+
+#: templates/index.html:24 templates/questions.html:26
+msgid "Questions with most answers"
+msgstr "被回复最多的问题"
+
+#: templates/index.html:24 templates/questions.html:26
+msgid "Hottest"
+msgstr "最热问题"
+
+#: templates/index.html:25 templates/questions.html:27
+msgid "Questions with most votes"
+msgstr "被投票最多的问题"
+
+#: templates/index.html:25 templates/questions.html:27
+msgid "Best"
+msgstr "最有价值问题"
+
+#: templates/index.html:26 templates/index.html.py:118
+#: templates/questions.html:22
+msgid "All questions"
+msgstr "所有问题"
+
+#: templates/index.html:26
+msgid "All"
+msgstr "所有问题"
+
+#: templates/index.html:45 templates/questions.html:44
+msgid "Answers"
+msgstr "回答"
+
+#: templates/index.html:47 templates/questions.html:46
+msgid "Visits"
+msgstr "访问"
+
+#: templates/index.html:55 templates/questions.html:57
+#: templates/questions.html.py:69
+msgid "Community wiki"
+msgstr "社区wiki"
+
+#: templates/index.html:67 templates/index.html.py:91
+#: templates/questions.html:83
+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/pagesize.html:5
+msgid "Size per page:"
+msgstr "每页显示:"
+
+#: templates/paginator.html:5
+msgid "Previous"
+msgstr "上一页"
+
+#: templates/questions.html:6
+msgid "Question list"
+msgstr "问题列表"
+
+#: templates/questions.html:22
+msgid "Tagged questions"
+msgstr "标签问题"
+
+#: templates/questions.html:22
+msgid "Query result"
+msgstr "查询结果"
+
+#: templates/questions.html:24
+msgid "New questions"
+msgstr "最新问题"
+
+#: templates/questions.html:25
+msgid "Active"
+msgstr "活跃问题"
+
+#: templates/questions.html:125
+msgid "Related tags"
+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 "请改正以下错误:"
+
+#: 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 "请修改您的OpenID地址,请不要忘记这个地址!"
+
+#: 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 "修改和你帐号绑定的OpenID地址"
+
+#: 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 -ruN CNPROG/middleware/pagesize.py mikes/middleware/pagesize.py
--- CNPROG/middleware/pagesize.py 1969-12-31 19:00:00.000000000 -0500
+++ mikes/middleware/pagesize.py 2009-07-25 19:09:58.108151006 -0400
@@ -0,0 +1,29 @@
+# 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 -ruN CNPROG/settings_local.py mikes/settings_local.py
--- CNPROG/settings_local.py 2009-07-25 18:49:15.158341746 -0400
+++ mikes/settings_local.py 1969-12-31 19:00:00.000000000 -0500
@@ -1,21 +0,0 @@
-# encoding:utf-8
-SITE_SRC_ROOT = '/change_me/'
-
-#for logging
-import logging
-LOG_FILENAME = SITE_SRC_ROOT + 'django.lanai.log'
-logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG,)
-
-DATABASE_NAME = 'cnprog' # Or path to database file if using sqlite3.
-DATABASE_USER = 'root' # Not used with sqlite3.
-DATABASE_PASSWORD = '' # Not used with sqlite3.
-
-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',
-)
diff -ruN CNPROG/settings_local.py.dist mikes/settings_local.py.dist
--- CNPROG/settings_local.py.dist 1969-12-31 19:00:00.000000000 -0500
+++ mikes/settings_local.py.dist 2009-07-25 19:09:58.108151006 -0400
@@ -0,0 +1,25 @@
+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 -ruN CNPROG/settings.py mikes/settings.py
--- CNPROG/settings.py 2009-07-25 18:49:15.158341746 -0400
+++ mikes/settings.py 2009-07-25 19:09:58.108151006 -0400
@@ -1,51 +1,24 @@
+# encoding:utf-8
# Django settings for lanai project.
import os.path
+#DEBUG SETTINGS
DEBUG = True
TEMPLATE_DEBUG = DEBUG
-
-
-#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 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
+#EMAIL AND ADMINS
ADMINS = (
- ('you', 'you@where.com'),
+ ('CNProg team', 'team@cnprog.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'
+SERVER_EMAIL = 'webmaster@cnprog.com'
+DEFAULT_FROM_EMAIL = 'webmaster@cnprog.com'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_SUBJECT_PREFIX = '[cnprog.com]'
@@ -53,44 +26,21 @@
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'
+#LOCALIZATIONS
+TIME_ZONE = 'Asia/Chongqing Asia/Chungking'
+# LANGUAGE_CODE = 'en-us'
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/".
+#OTHER SETTINS
+APP_TITLE = u'CNProg.com 程序员问答社区'
+APP_URL = 'http://www.cnprog.com'
+APP_KEYWORDS = u'技术问答社区,中国程序员,编程技术社区,程序员社区,程序员论坛,程序员wiki,程序员博客'
+APP_DESCRIPTION = u'中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。'
+APP_INTRO = u'