Monday, March 30, 2015

Regarding validators (user defined)

Hi,

I've two queries related to validators, would appreciate if someone could reply.

(1) As part of my application, I'm planning to add new validators. Is there any documentation on best practices of doing the same? I've been looking into https://docs.djangoproject.com/en/1.7/_modules/django/core/validators/ to get some ideas though.

(2) If I were to allow users to attach validators to a field and define their parameters, what would be the best way? For instance, let's say the user would like to apply a RegexValidator on a CharField() where the 'regex' parameter is defined by the user. How would I achieve that behaviour?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3c850ec8-9bde-4197-91ca-b1c35e3baf0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment