Browse Source

Merge branch 'master' of https://git.swzry.com/zry/pichu_blog.git

zry 8 years ago
parent
commit
0e03fabecf
1 changed files with 6 additions and 1 deletions
  1. 6 1
      forms.py

+ 6 - 1
forms.py

@@ -37,7 +37,7 @@ logger = logging.getLogger('userlog_file')
 # 	self.mc_validate(value)
 # 	return value
 
-class UserMultiChoiceField(forms.MultipleChoiceField):
+class UserMultiChoiceField(forms.ModelMultipleChoiceField):
 	def validate(self,value):
 		if self.required and not value:
 			raise ValidationError(self.error_messages['required'], code='required')
@@ -84,6 +84,11 @@ class EditPostForm(forms.ModelForm):
 		self.fields['markdown'].error_messages={'required':u"请输入正文"}
 
 class PostPermForm(forms.ModelForm):
+	readuin = UserMultiChoiceField(queryset=None)
+	readuex = UserMultiChoiceField(queryset=None)
+	commentuin = UserMultiChoiceField(queryset=None)
+	commentuex = UserMultiChoiceField(queryset=None)
+
 	class Meta:
 		model = BlogPost
 		fields = ['private','passwdlck','passwd','readgrp','readuin','readuex','freecomment','commentgrp','commentuin','commentuex']