def clean_fields(self, exclude=None):
		"""
		This is an override of the default model clean_fields method. Essentially, in addition to validating the fields, this method validates the :class:`Template` instance that is used to render this :class:`Page`. This is useful for catching template errors before they show up as 500 errors on a live site.
		
		"""
		if exclude is None:
			exclude = []
		
		try:
			super(Page, self).clean_fields(exclude)
		except ValidationError, e:
			errors = e.message_dict
		else:
			errors = {}
		
		if 'template' not in errors and 'template' not in exclude:
			try:
				self.template.clean_fields()
				self.template.clean()
			except __HOLE__, e:
				errors['template'] = e.messages
		
		if errors:
			raise ValidationError(errors)
dataset/ETHPy150Open ithinksw/philo/philo/models/pages.py/Page.clean_fields