Hi Dmitry,

I think we could have combination of "validators" + "processors":
they will return either exception or cleaned value.

For example,
SomeField(cleaners=[clean_and_validate_email()])

Did you mean exactly this or rather separated SomeField(validators=[...],
processors=[...]) ?

On Mon, Jul 11, 2011 at 6:31 PM, Dmitry Gladkov <dmitry.glad...@gmail.com>wrote:

> I don't see what's wrong with 'strip' attribute for models.Field,
> we've already non database-related 'blank' attribute, but I agree that
> it does not solve the general problem.
>
> What I'm thinking about is something like django.core.validators [1],
> but called 'processors' with the only and main difference that
> processor returns value which gets passed to the next processor in
> chain.
>
> I'm not sure that it plays nice with existing clean_[fieldname]
> methods and that 'processor' is a good name either, but I'd like to
> hear what do you think about this idea.
>
> Thanks.
>
>
> [1]
> https://docs.djangoproject.com/en/dev/ref/forms/validation/#using-validators
>
>
> --
> Best wishes,
> Dmitry Gladkov, mailto:dmitry.glad...@gmail.com
>
> +380 91 303-37-46
>
>
>
> On Mon, Jul 11, 2011 at 12:26 AM, Chris Beaven <smileych...@gmail.com>
> wrote:
> > To clarify, didn't even notice we were talking about models.Field, I'm +0
> > for a 'strip' attribute on the form's field, nothing on the model.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django developers" group.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msg/django-developers/-/r9DLUCsK6rUJ.
> > To post to this group, send email to django-developers@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-developers+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-developers?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>


-- 
Best regards, Yuri V. Baburov, Skype: yuri.baburov, MSN: bu...@live.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to