示例#1
0
	def clean_url_title(self):
		super().clean()
		url_title = self.cleaned_data['url_title'].lower()
		if url_title.startswith('temp_'):
			# the url_title must not start with temp anymore!
			raise ValidationError(_("You are not allowed to use `temp_` as prefix for the URL"))
		return slugify_and_clean_url_title(self.instance, url_title)
示例#2
0
文件: forms.py 项目: cmfcmf/1327
	def clean_url_title(self):
		super().clean()
		url_title = self.cleaned_data['url_title'].lower()
		if url_title.startswith('temp_'):
			# the url_title must not start with temp anymore!
			raise ValidationError(_("You are not allowed to use `temp_` as prefix for the URL"))
		return slugify_and_clean_url_title(self.instance, url_title)
示例#3
0
文件: forms.py 项目: xasetl/1327
	def clean_url_title(self):
		super().clean()
		url_title = self.cleaned_data['url_title'].lower()
		return slugify_and_clean_url_title(self.instance, url_title)
示例#4
0
文件: forms.py 项目: maikz/1327
 def clean_url_title(self):
     super().clean()
     url_title = self.cleaned_data['url_title'].lower()
     return slugify_and_clean_url_title(self.instance, url_title)