コード例 #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)