Hi Claude,

On 24 Apr 2016, at 20:58, Claude Paroz <[email protected]> wrote:
> 
> Le samedi 23 avril 2016 14:33:56 UTC+2, Aymeric Augustin a écrit :
> 
> You added a username_validator attribute instead of documenting how to 
> override the whole username field. Can you elaborate on this decision? I 
> simplifies the use case targeted by the patch by introducing a one-off API. 
> As a matter of principle I'm a bit skeptical of such special cases. But I 
> understand the convenience.
> 
> My preoccupation here was not to force users to create a custom user model 
> just to change the username validation, especially as the migration system 
> doesn't seem to support yet upgrading from the standard auth User to a custom 
> user. I thought that creating a proxy custom user is easier migration-wise, 
> as no new table is required. But I may be wrong.

I believe that you can switch to a custom user model that has the same fields 
as auth.User just by declaring db_table = ‘auth_user’. You may still have to 
throw away your migration history and recreate a fresh set of migrations. I 
made these tests some time ago and I’m not sure of the results. Indeed, a proxy 
model is easier.

On a side note, we should recommend to always start with a custom user model… I 
don’t know if we added that to the docs.

> Globally, I totally understand your opinion, and I agree there is no "right" 
> or "wrong" solution. Eventually, this might be a decision to be brought to 
> the technical broad.

It’s a -0 from me, not a -1, and it may turn into a +0 as time passes... More 
arguments or opinions, especially backed by data or experience, would certainly 
be useful.

-- 
Aymeric.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/593A78A0-1078-42D1-AD59-41E1105B5715%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to