aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--account/admin.py2
-rw-r--r--account/forms.py15
-rw-r--r--account/migrations/0003_auto__rename_field_userprofile_identify_to_identity.py84
-rw-r--r--account/models.py28
-rw-r--r--account/templates/account/list_approved.html4
-rw-r--r--account/templates/account/profile.html4
-rw-r--r--locale/zh_CN/LC_MESSAGES/django.mobin6465 -> 6488 bytes
-rw-r--r--locale/zh_CN/LC_MESSAGES/django.po92
8 files changed, 156 insertions, 73 deletions
diff --git a/account/admin.py b/account/admin.py
index 46498eb..3ed5276 100644
--- a/account/admin.py
+++ b/account/admin.py
@@ -36,7 +36,7 @@ class UserProfileAdmin(admin.ModelAdmin):
'realname',
'gender',
'institute',
- 'identify',
+ 'identity',
'reason',
'transcript_url',
'supplement',
diff --git a/account/forms.py b/account/forms.py
index cb0b6b2..daa6683 100644
--- a/account/forms.py
+++ b/account/forms.py
@@ -21,13 +21,12 @@ class UserRegForm(RegistrationFormUniqueEmail):
based on 'django-registration' RegistrationFormUniqueEmail
add fields 'realname', 'gender', 'institute' and 'captcha'
"""
- # XXX: keep consistent with GENDERS in 'models.UserProfile'
GENDERS = UserProfile.GENDERS
- IDENTIFIES = UserProfile.IDENTIFIES
+ IDENTITIES = UserProfile.IDENTITIES
realname = forms.CharField(max_length=30, label=_("Name"))
gender = forms.ChoiceField(choices=GENDERS, label=_("Gender"))
- institute = forms.CharField(max_length=100, label=_("Institute"))
- identify = forms.ChoiceField(choices=IDENTIFIES, label=_("Identify"))
+ institute = forms.CharField(max_length=100, label=_("Institute (and major)"))
+ identity = forms.ChoiceField(choices=IDENTITIES, label=_("Identity"))
captcha = ReCaptchaField(label=_("Captcha"),
attrs={'theme': 'clean'})
@@ -42,7 +41,7 @@ class UserRegForm(RegistrationFormUniqueEmail):
# 'realname',
# 'gender',
# 'institute',
- # 'identify',
+ # 'identity',
# ]
@@ -110,7 +109,7 @@ class UpdateProfileForm(forms.ModelForm):
'realname',
'gender',
'institute',
- 'identify',
+ 'identity',
'reason',
'transcript',
'supplement',
@@ -128,7 +127,7 @@ class UpdateProfileForm(forms.ModelForm):
'email',
'gender',
'institute',
- 'identify',
+ 'identity',
'reason',
'transcript',
'supplement',
@@ -141,7 +140,7 @@ class UpdateProfileForm(forms.ModelForm):
form_data = self.cleaned_data
user = form_data.get('user')
profile = user.userprofile_set.get(user=user)
- profile.identify = form_data.get('identify', profile.identify)
+ profile.identity = form_data.get('identity', profile.identity)
transcript = self.cleaned_data.get('transcript', False)
if (profile.is_transcript_required() and (not transcript)):
raise forms.ValidationError(_("Transcript is required."), code='required')
diff --git a/account/migrations/0003_auto__rename_field_userprofile_identify_to_identity.py b/account/migrations/0003_auto__rename_field_userprofile_identify_to_identity.py
new file mode 100644
index 0000000..ae02a3b
--- /dev/null
+++ b/account/migrations/0003_auto__rename_field_userprofile_identify_to_identity.py
@@ -0,0 +1,84 @@
+# -*- coding: utf-8 -*-
+from south.utils import datetime_utils as datetime
+from south.db import db
+from south.v2 import SchemaMigration
+from django.db import models
+
+
+class Migration(SchemaMigration):
+
+ def forwards(self, orm):
+ # Rename field 'identify' to 'identity'
+ db.rename_column(u'account_userprofile', 'identify', 'identity')
+
+
+ def backwards(self, orm):
+ # Rename field 'identity' to 'identify'
+ db.rename_column(u'account_userprofile', 'identity', 'identify')
+
+
+ models = {
+ u'account.userfile': {
+ 'Meta': {'ordering': "['user', 'id']", 'object_name': 'UserFile'},
+ 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+ 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'file': ('account.extra.ContentTypeRestrictedFileField', [], {'content_types': "['application/gzip', 'application/msword', 'application/pdf', 'application/postscript', 'application/rar', 'application/vnd.ms-excel', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/wps-office.doc', 'application/wps-office.dps', 'application/wps-office.et', 'application/wps-office.ppt', 'application/wps-office.pptx', 'application/wps-office.wps', 'application/wps-office.xls', 'application/zip', 'application/x-7z-compressed', 'application/x-bzip2', 'application/x-dvi', 'application/x-latex', 'application/x-rar-compressed', 'application/x-tar', 'image/bmp', 'image/gif', 'image/jpeg', 'image/png', 'image/tiff', 'text/csv', 'text/plain', 'text/rtf', 'text/x-markdown', 'text/x-tex']", 'max_upload_size': '10485760', 'max_length': '100'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'modified_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"})
+ },
+ u'account.userprofile': {
+ 'Meta': {'object_name': 'UserProfile'},
+ 'gender': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'identity': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
+ 'institute': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'is_approved': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '1'}),
+ 'is_checkin': ('django.db.models.fields.CharField', [], {'default': "'X'", 'max_length': '1'}),
+ 'is_sponsored': ('django.db.models.fields.CharField', [], {'default': "'C'", 'max_length': '1'}),
+ 'realname': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
+ 'reason': ('django.db.models.fields.TextField', [], {}),
+ 'supplement': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'transcript': ('account.extra.ContentTypeRestrictedFileField', [], {'content_types': "['application/gzip', 'application/msword', 'application/pdf', 'application/postscript', 'application/rar', 'application/vnd.ms-excel', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/wps-office.doc', 'application/wps-office.dps', 'application/wps-office.et', 'application/wps-office.ppt', 'application/wps-office.pptx', 'application/wps-office.wps', 'application/wps-office.xls', 'application/zip', 'application/x-7z-compressed', 'application/x-bzip2', 'application/x-dvi', 'application/x-latex', 'application/x-rar-compressed', 'application/x-tar', 'image/bmp', 'image/gif', 'image/jpeg', 'image/png', 'image/tiff', 'text/csv', 'text/plain', 'text/rtf', 'text/x-markdown', 'text/x-tex']", 'max_upload_size': '10485760', 'null': 'True', 'max_length': '100', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']", 'unique': 'True'})
+ },
+ u'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ u'auth.permission': {
+ 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ u'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Group']"}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "u'user_set'", 'blank': 'True', 'to': u"orm['auth.Permission']"}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ u'contenttypes.contenttype': {
+ 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+ 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+ }
+ }
+
+ complete_apps = ['account']
diff --git a/account/models.py b/account/models.py
index fba0f48..0565731 100644
--- a/account/models.py
+++ b/account/models.py
@@ -48,8 +48,8 @@ class UserProfile(models.Model):
('N', _("No")),
('X', _("N/A")),
)
- # choices for identify
- IDENTIFIES = (
+ # choices for identity
+ IDENTITIES = (
('OT', _("Other")),
('UG', _("Undergraudate (junior and below)")),
('U4', _("Undergraudate (senior)")),
@@ -70,9 +70,9 @@ class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True, verbose_name=_("User"))
realname = models.CharField(_("Name"), max_length=30)
gender = models.CharField(_("Gender"), max_length=1, choices=GENDERS)
- institute = models.CharField(_("Institute"), max_length=100)
- identify = models.CharField(_("Identify"), max_length=2,
- choices=IDENTIFIES)
+ institute = models.CharField(_("Institute (and major)"), max_length=100)
+ identity = models.CharField(_("Identity"), max_length=2,
+ choices=IDENTITIES)
# reasons to participate
reason = models.TextField(_("Why attend"))
# transcript: needed if undergraudate (junior and below)
@@ -123,10 +123,10 @@ class UserProfile(models.Model):
def is_transcript_required(self):
"""
- if 'identify' is UG (undergraduate junior and below); then
+ if 'identity' is UG (undergraduate junior and below); then
transcript is required, return True. Otherwise, return False
"""
- if (self.identify == 'UG'):
+ if (self.identity == 'UG'):
return True
else:
return False
@@ -175,12 +175,12 @@ class UserProfile(models.Model):
checkin_dict = dict((k, v) for k, v in self.CHECKIN_STATUS)
return checkin_dict.get(self.is_checkin)
- def get_identify_value(self):
+ def get_identity_value(self):
"""
- return the corresponding value of identify for the user
+ return the corresponding value of identity for the user
"""
- identifies_dict = dict((k, v) for k, v in self.IDENTIFIES)
- return identifies_dict.get(self.identify)
+ identifies_dict = dict((k, v) for k, v in self.IDENTITIES)
+ return identifies_dict.get(self.identity)
def get_userfiles(self):
"""
@@ -198,7 +198,7 @@ class UserProfile(models.Model):
'realname': self._meta.get_field_by_name('realname')[0].verbose_name,
'gender': self._meta.get_field_by_name('gender')[0].verbose_name,
'institute': self._meta.get_field_by_name('institute')[0].verbose_name,
- 'identify': self._meta.get_field_by_name('identify')[0].verbose_name,
+ 'identity': self._meta.get_field_by_name('identity')[0].verbose_name,
'reason': self._meta.get_field_by_name('reason')[0].verbose_name,
'transcript': self._meta.get_field_by_name('transcript')[0].verbose_name,
'supplement': self._meta.get_field_by_name('supplement')[0].verbose_name,
@@ -225,7 +225,7 @@ class UserProfile(models.Model):
'realname': self.realname,
'gender': self.get_gender_value(),
'institute': self.institute,
- 'identify': self.get_identify_value(),
+ 'identity': self.get_identity_value(),
'reason': self.reason,
'transcript': transcript,
'supplement': self.supplement,
@@ -298,7 +298,7 @@ def user_registered_callback(sender, user, request, **kwargs):
profile.realname = request.POST['realname']
profile.gender = request.POST['gender']
profile.institute = request.POST['institute']
- profile.identify = request.POST['identify']
+ profile.identity = request.POST['identity']
profile.save()
# connect 'user_registered_callback' to signal user_registered
diff --git a/account/templates/account/list_approved.html b/account/templates/account/list_approved.html
index 8c2587d..0db16af 100644
--- a/account/templates/account/list_approved.html
+++ b/account/templates/account/list_approved.html
@@ -25,7 +25,7 @@
<tr>
<th class="col-md-1 list-number">序号</th>
<th class="col-md-2 list-name">姓名</th>
- {# <th class="col-md-3 list-identify">身份</th> #}
+ {# <th class="col-md-3 list-identity">身份</th> #}
<th class="col-md-6 list-institute">单位(及专业)</th>
</tr>
</thead>
@@ -35,7 +35,7 @@
<tr{% if approved_profile.user == user %} class="success"{% endif %}>
<td>{{ forloop.counter }}</td>
<td>{{ approved_profile.realname }}</td>
- {# <td>{% trans approved_profile.get_identify_value %}</td> #}
+ {# <td>{% trans approved_profile.get_identity_value %}</td> #}
<td>{{ approved_profile.institute }}</td>
</tr>
{% endfor %}
diff --git a/account/templates/account/profile.html b/account/templates/account/profile.html
index 88e938f..d2b73e7 100644
--- a/account/templates/account/profile.html
+++ b/account/templates/account/profile.html
@@ -58,8 +58,8 @@
<td class="profile-institute-data">{{ profile.institute }}</td>
</tr>
<tr>
- <th class="profile-identify">身份</th>
- <td class="profile-identify-data">{% trans profile.get_identify_value %}</td>
+ <th class="profile-identity">身份</th>
+ <td class="profile-identity-data">{% trans profile.get_identity_value %}</td>
</tr>
<tr>
<th class="profile-reason">为什么参加</th>
diff --git a/locale/zh_CN/LC_MESSAGES/django.mo b/locale/zh_CN/LC_MESSAGES/django.mo
index 74aab7f..453dabe 100644
--- a/locale/zh_CN/LC_MESSAGES/django.mo
+++ b/locale/zh_CN/LC_MESSAGES/django.mo
Binary files differ
diff --git a/locale/zh_CN/LC_MESSAGES/django.po b/locale/zh_CN/LC_MESSAGES/django.po
index a9f0ad7..67f2a6b 100644
--- a/locale/zh_CN/LC_MESSAGES/django.po
+++ b/locale/zh_CN/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-05-20 21:09+0800\n"
+"POT-Creation-Date: 2014-06-03 00:20+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Weitian LI <liweitianux@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,136 +18,136 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-#: account/admin.py:59
+#: account/admin.py:63
msgid "1 user was successfully approved."
msgstr "1个用户被成功审定."
-#: account/admin.py:61
+#: account/admin.py:65
#, python-format
msgid "%(num)s users were successfully approved."
msgstr "%(num)s个用户被成功审定."
-#: account/admin.py:63
+#: account/admin.py:67
msgid "Approve users"
msgstr "审定用户"
-#: account/admin.py:71
+#: account/admin.py:75
msgid "1 user was successfully sponsored."
msgstr "1个用户被成功资助."
-#: account/admin.py:73
+#: account/admin.py:77
#, python-format
msgid "%(num)s users were successfully sponsored."
msgstr "%(num)s个用户被成功资助."
-#: account/admin.py:75
+#: account/admin.py:79
msgid "Sponsor users"
msgstr "资助用户"
-#: account/admin.py:83
+#: account/admin.py:87
msgid "1 user was successfully cancelled approval."
msgstr "1个用户的审定被取消."
-#: account/admin.py:85
+#: account/admin.py:89
#, python-format
msgid "%(num)s users were successfully cancelled approval."
msgstr "%(num)s个用户的审定被取消."
-#: account/admin.py:87
+#: account/admin.py:91
msgid "Cancel approve users"
msgstr "取消用户审定"
-#: account/admin.py:95
+#: account/admin.py:99
msgid "1 user was successfully cancelled sponsor."
msgstr "1个用户的资助被取消."
-#: account/admin.py:97
+#: account/admin.py:101
#, python-format
msgid "%(num)s users were successfully cancelled sponsor."
msgstr "%(num)s个用户的资助被取消."
-#: account/admin.py:99
+#: account/admin.py:103
msgid "Cancel sponsor users"
msgstr "取消用户资助"
-#: account/admin.py:107
+#: account/admin.py:111
msgid "1 user was successfully reset approval."
msgstr "1个用户的审定被重置."
-#: account/admin.py:109
+#: account/admin.py:113
#, python-format
msgid "%(num)s users were successfully reset approval."
msgstr "%(num)s个用户的审定被重置."
-#: account/admin.py:111
+#: account/admin.py:115
msgid "Reset approve users"
msgstr "重置用户审定"
-#: account/admin.py:119
+#: account/admin.py:123
msgid "1 user was successfully reset sponsor."
msgstr "1个用户的资助被重置."
-#: account/admin.py:121
+#: account/admin.py:125
#, python-format
msgid "%(num)s users were successfully reset sponsor."
msgstr "%(num)s个用户的审定被重置."
-#: account/admin.py:123
+#: account/admin.py:127
msgid "Reset sponsor users"
msgstr "重置用户资助"
-#: account/admin.py:132
+#: account/admin.py:136
msgid "1 user was successfully marked as checkin."
msgstr "1个用户被标记为已报到."
-#: account/admin.py:134
+#: account/admin.py:138
#, python-format
msgid "%(num)s users were successfully marked as checkin."
msgstr "%(num)s个用户被标记为已报到."
-#: account/admin.py:136
+#: account/admin.py:140
msgid "Mark users as checked in"
msgstr "标记用户为已报到"
-#: account/admin.py:144
+#: account/admin.py:148
msgid "1 user was marked as not checkin."
msgstr "1个用户被标记为未报到."
-#: account/admin.py:146
+#: account/admin.py:150
#, python-format
msgid "%(num)s users were marked as not checkin."
msgstr "%(num)s个用户被标记为未报到."
-#: account/admin.py:148
+#: account/admin.py:152
msgid "Mark users as not checked in"
msgstr "标记用户为未报到"
-#: account/admin.py:156
+#: account/admin.py:160
msgid "1 user was reset status of checkin."
msgstr "1个用户的报到状态被重置."
-#: account/admin.py:158
+#: account/admin.py:162
#, python-format
msgid "%(num)s users were reset status of checkin."
msgstr "%(num)s个用户的报到状态被重置."
-#: account/admin.py:160
+#: account/admin.py:164
msgid "Reset users checkin status"
msgstr "重置用户报到状态"
-#: account/admin.py:169 account/forms.py:59 account/forms.py:104
+#: account/admin.py:173 account/forms.py:58 account/forms.py:103
msgid "E-mail"
msgstr "邮箱"
-#: account/admin.py:182 account/admin.py:201
+#: account/admin.py:186 account/admin.py:205
msgid "Null"
msgstr "无"
-#: account/admin.py:184 account/models.py:80
+#: account/admin.py:188 account/models.py:80
msgid "Transcript"
msgstr "成绩单"
-#: account/admin.py:203
+#: account/admin.py:207
msgid "Attachments"
msgstr "附件"
@@ -160,47 +160,47 @@ msgstr "请使文件小于%(maxsize)s. 当前大小%(filesize)s"
msgid "Unsupported filetype"
msgstr "不支持的文件类型"
-#: account/forms.py:27 account/models.py:71
+#: account/forms.py:26 account/models.py:71
msgid "Name"
msgstr "姓名"
-#: account/forms.py:28 account/models.py:72
+#: account/forms.py:27 account/models.py:72
msgid "Gender"
msgstr "性别"
-#: account/forms.py:29 account/models.py:73
-msgid "Institute"
-msgstr "单位"
+#: account/forms.py:28 account/models.py:73
+msgid "Institute (and major)"
+msgstr "单位(及专业)"
-#: account/forms.py:30 account/models.py:74
-msgid "Identify"
+#: account/forms.py:29 account/models.py:74
+msgid "Identity"
msgstr "身份"
-#: account/forms.py:31
+#: account/forms.py:30
msgid "Captcha"
msgstr "验证码"
-#: account/forms.py:55
+#: account/forms.py:54
msgid "Username"
msgstr "用户名"
-#: account/forms.py:56
+#: account/forms.py:55
msgid "This value may contain only letters, numbers and @/./+/-/_ characters."
msgstr "请只使用英文字母数字和@.+-_字符"
-#: account/forms.py:57
+#: account/forms.py:56
msgid "Is update email"
msgstr "是否更新邮箱地址"
-#: account/forms.py:65
+#: account/forms.py:64
msgid "Username not exists"
msgstr "该用户名不存在"
-#: account/forms.py:73
+#: account/forms.py:72
msgid "Email is required"
msgstr "必须填写邮箱地址"
-#: account/forms.py:147
+#: account/forms.py:146
msgid "Transcript is required."
msgstr "必须上传成绩单"