Whither Validators?

102 views
Skip to first unread message

Rodrigo Culagovski

unread,
Sep 24, 2008, 12:30:47 PM9/24/08
to Django users
Validators (django.core.validators) seem to have been removed from
1.0. What replaces them?

bruno desthuilliers

unread,
Sep 24, 2008, 3:20:08 PM9/24/08
to Django users
On 24 sep, 18:30, Rodrigo Culagovski <rodrigo...@gmail.com> wrote:
> Validators (django.core.validators) seem to have been removed from
> 1.0. What replaces them?

Nothing yet AFAICT.

Rodrigo Culagovski

unread,
Sep 24, 2008, 3:40:09 PM9/24/08
to Django users
So, do you have to override the model's save method and do your
validation there?

On Sep 24, 3:20 pm, bruno desthuilliers

Russell Keith-Magee

unread,
Sep 24, 2008, 7:41:54 PM9/24/08
to django...@googlegroups.com

Well... validators weren't ever really there to begin with. There was
some initial stub code, but it wasn't fully integrated into models.

Model validation (Ticket #6845) was on the list of possible v1.0
features, but got bumped from the feature list because the
implementation wasn't quite ready. It's certainly on the list of
features intended for v1.1.

In the meantime, there is form-level validation; you can also override
the save() method to ensure that invalid models aren't saved. It's not
particularly pretty, but a better solution is on the way. If you're
feeling adventurous, you can try out the patch on #6845 and let us
know about any problems you have.

Yours,
Russ Magee %-)

Rodrigo Culagovski

unread,
Sep 25, 2008, 8:52:58 AM9/25/08
to Django users
Ok, so if I raiseValidationError in the save() methods, will this just
give a big fat ugly general error, or a cute "You have to provide your
complete credit card number" error?

Thanks for the clarification.

Rodrigo

On Sep 24, 7:41 pm, "Russell Keith-Magee" <freakboy3...@gmail.com>
wrote:
> On Thu, Sep 25, 2008 at 12:30 AM, Rodrigo Culagovski
>

Russell Keith-Magee

unread,
Sep 25, 2008, 9:42:19 AM9/25/08
to django...@googlegroups.com
On Thu, Sep 25, 2008 at 8:52 PM, Rodrigo Culagovski
<rodri...@gmail.com> wrote:
>
> Ok, so if I raiseValidationError in the save() methods, will this just
> give a big fat ugly general error, or a cute "You have to provide your
> complete credit card number" error?

Well... it will do whatever you program it to do. It depends entirely
on the validation error that you raise, where you catch that error,
and how you process it.

Yours,
Russ Magee %-)

Reply all
Reply to author
Forward
0 new messages