Задать вопрос

Тел: +7 965 3737 888

447

Просмотров

2

Ответов

UsernameField (for clean error messages)

<p>This is a username field that matches (and slightly tightens) the constraints on usernames in Django's User model. </p>
<p>Most people use RegexField, which is totally fine -- but it can't provide the fine-grained and user friendly messages that come from this field.</p>

Вопрос полезен? Да0/Нет0
file_5152.py(1.7Кб)
None

Ответы (2):

Ответdavepeck:12.08.2009
Ответ полезен? Да0/Нет0

diverman: You missed the point. :-)

Sometimes you've got to return precise, friendly error messages. This is especially true when you want your users to actually have a shot at signing in. You could use a RegexField, and if it doesn't validate you could always display the same error message regardless of the root cause. Or you could use this class to get easier to understand fine-grained error messages for entered user names.

RegexField is not the solution to all the world's woes -- especially where human factors are involved.

Ответdiverman:11.08.2009
Ответ полезен? Да0/Нет0

Look at RegexField...