validator_list still in docs

22 views
Skip to first unread message

Alex Rades

unread,
Aug 23, 2008, 10:02:51 AM8/23/08
to django-d...@googlegroups.com
Hi,
validator_list in model fields (and maybe in form fields too) isn't
working at the moment.

Could we remove it from the docs?

Malcolm Tredinnick

unread,
Aug 23, 2008, 12:43:06 PM8/23/08
to django-d...@googlegroups.com

It will be removed eventually, when all the remaining oldforms stuff is
removed (before 1.0). Also, there's a temporary freeze on docs changes
at the moment until the docs refactor lands.

Regards,
Malcolm


Dennis Schmidt

unread,
Aug 25, 2008, 8:08:29 AM8/25/08
to Django developers
Hi there,

if this will be deactivated in 1.0, how do I have to replace this? I
couldn't find an easy way like this in the docs yet.

Regards,
Dennis

On 23 Aug., 18:43, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:

Malcolm Tredinnick

unread,
Aug 25, 2008, 11:12:58 AM8/25/08
to django-d...@googlegroups.com

On Mon, 2008-08-25 at 05:08 -0700, Dennis Schmidt wrote:
> Hi there,
>
> if this will be deactivated in 1.0, how do I have to replace this? I
> couldn't find an easy way like this in the docs yet.

Validators are really only used by the admin in 0.96 (there was no
model-aware validation there). In 1.0, there will still be no
model-aware validation -- we pushed that to post-1.0 a little while ago
-- and the admin interface uses forms validation plus a couple of manual
checks for things like unique-together.

So there isn't a direct replacement for validator lists in 1.0.

Regards,
Malcolm


James Bennett

unread,
Aug 25, 2008, 11:54:31 AM8/25/08
to django-d...@googlegroups.com
On Mon, Aug 25, 2008 at 10:12 AM, Malcolm Tredinnick
<mal...@pointy-stick.com> wrote:
> So there isn't a direct replacement for validator lists in 1.0.

(other than just setting up the form used for your model in the admin
to have the validation you want, which isn't terribly hard and is how
this sort of stuff should have worked long ago)


--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Michael Hrivnak

unread,
Aug 25, 2008, 7:57:28 PM8/25/08
to django-d...@googlegroups.com
That is neither a direct nor indirect replacement for model-level validation.
Many applications receive input from sources other than forms. Validation at
the form and model level are both valuable, but for different reasons.

Michael

signature.asc

Karen Tracey

unread,
Aug 25, 2008, 8:08:48 PM8/25/08
to django-d...@googlegroups.com
On Mon, Aug 25, 2008 at 7:57 PM, Michael Hrivnak <mhri...@americanri.com> wrote:
That is neither a direct nor indirect replacement for model-level validation.
Many applications receive input from sources other than forms.  Validation at
the form and model level are both valuable, but for different reasons.

Yes, which is way ticket #6845 is still open.  Model-validation hasn't been dropped, just pushed (with reluctance) to post-1.0.

Karen

Malcolm Tredinnick

unread,
Aug 25, 2008, 8:12:32 PM8/25/08
to django-d...@googlegroups.com

On Mon, 2008-08-25 at 19:57 -0400, Michael Hrivnak wrote:
> That is neither a direct nor indirect replacement for model-level validation.
> Many applications receive input from sources other than forms. Validation at
> the form and model level are both valuable, but for different reasons.

It is an indirect way to achieve something very close. Nothing requires
that the data you pass to a ModelForm class has to come from an HTML
form submission, so the restriction you mention doesn't actually
exist. :-)

So you can create a ModelForm, pass in a model instance, check
is_valid() and then carry on if things pass.

Is it a bit of a hack? Yes. Will it suffice for the time being until
model-validation is available? Also yes, since we don't have a choice.

Regards,
Malcolm


James Bennett

unread,
Aug 26, 2008, 3:21:44 AM8/26/08
to django-d...@googlegroups.com
On Mon, Aug 25, 2008 at 6:57 PM, Michael Hrivnak
<mhri...@americanri.com> wrote:
> That is neither a direct nor indirect replacement for model-level validation.
> Many applications receive input from sources other than forms. Validation at
> the form and model level are both valuable, but for different reasons.

True, but Django has *never* supported model-level validation;
validator_list has always only been a shortcut for specifying some
validation logic that shows up in automatically-generated forms.

Reply all
Reply to author
Forward
0 new messages