﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12752	validators should allow check against empty to be customized	Shaun Cutts	nobody	"I have a custom field, which sets up a correspondence between a numpy array and a postgres array. It mostly seems to be working. However, when I call .full_clean() on a model containing such a field, the validation code eventually calls:

django.db.models.fields.__init__.py(207)validate():

{{{
206  	
207  ->	        if not self.blank and value in validators.EMPTY_VALUES:
208  	            raise exceptions.ValidationError(self.error_messages['blank'])
}}}

Here, the numpy definition for equality snarls things, and I get:
{{{
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
}}}

I suggest a {{{ django.db.models.Field }}} member {{{ is_empty }}} be added, which does {{{ value in validators.EMPTY_VALUES }}} by default, but can be overridden by a custom subclass.

"	New feature	closed	Database layer (models, ORM)	1.2-alpha	Normal	fixed		shaun@…	Accepted	0	0	0	0	0	0
