Wednesday, July 29, 2015

Re: About models validators location

Yeah, I can put it whenever I want, and just import then, but it is good to know the exact way (as when following PEP 8).

El miércoles, 29 de julio de 2015, 17:40:45 (UTC+2), felix escribió:
El 29/07/15 10:54, durir...@gmail.com escribió:
I've searched for where to put the validators for my models, but I only found that they fit in models.py, outside the model class.
Is that correct or I should create a specific file for them?

I think that you can put validators in another file if you have several of them or want to reuse them somewhere else. Just import them in models.py.

--
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/af351e20-a462-473a-afd7-7ca688875fc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment