Hi Anders, I think we need to make it as easy as possible for people to add back the 30-character restriction if they want, especially in the admin. Really good documentation of what to do should be good enough I hope, but we need to make sure it's easy and there aren't too many side-effects.
Thanks, Collin On Thursday, July 9, 2015 at 9:49:42 AM UTC-4, Anders Petersson wrote: > > Hey, I would like to see this get into 1.9, > > Can anyone suggest whats needed to merge > https://github.com/django/django/pull/4250 ? > > On Tuesday, June 2, 2015 at 3:18:35 AM UTC+2, Ryan Floyd wrote: >> >> I solved this in a very hacky way, without touching any django code. I'll >> probably break the forms >> >> 1. Create an empty migration (python manage.py makemigrations --name >> extend_username_field --empty [app_name]) >> 2. Inside the migration, add: >> ``` >> operations = [ >> migrations.RunSQL('ALTER TABLE auth_user ALTER COLUMN username TYPE >> varchar(254);') >> ] >> ``` >> >> Works so far, but haven't really tested it extensively >> >> -Ryan >> >> On Wednesday, April 22, 2015 at 10:26:31 AM UTC-5, Micah Hausler wrote: >>> >>> I actually migrated my site to 1.7 and added a custom user model very >>> easily. Here's a gist with the code, >>> https://gist.github.com/micahhausler/63636f26cc87bb966218, but >>> essentially all I had to do was add a new user app, copy the Django >>> AbstractUser code, and set the db_table to 'auth_user'. >>> >>> >>> class User(AbstractBaseUser, PermissionsMixin): >>> >>> objects = UserManager() >>> >>> class Meta: >>> db_table = 'auth_user' >>> >>> >>> >>> Does anyone think this method could be worth adding to the Django >>> documentation? I'd be happy to open a ticket/write the docs. The only side >>> effect would be that if someone were using content-types for auth_user >>> objects, that would need to be migrated. >>> >>> Micah Hausler >>> >>> >>> On Friday, February 6, 2015 at 8:10:02 PM UTC-5, Collin Anderson wrote: >>>> >>>> Hi All, >>>> >>>> I was reminded by: >>>> Allow shadowing of abstract fields >>>> https://groups.google.com/d/msg/django-developers/6zUfnElOIks/8uwXji559EsJ >>>> and https://code.djangoproject.com/ticket/24288 (Custom User Models >>>> for small tweaks). >>>> >>>> Could we reopen https://code.djangoproject.com/ticket/20846 and >>>> increase User.username max_length to 254? >>>> >>>> Personally, that's the only thing I've ever needed to change about my >>>> User class. I just need it long enough to hold email addresses. I've seen >>>> many other people wanting the same thing. >>>> >>>> In 1.8 we migrated the length of EmailField from 75 to 254, so it >>>> should be almostâ„¢ as easy to change the username field. >>>> >>>> If needed, we could keep the 30-character limit on UserCreationForm and >>>> UserChangeForm for backwards compatibility. The limit in the database is >>>> the real killer :) Though, consistency is also nice. >>>> >>>> Thanks, >>>> Collin >>>> >>>> -- 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 django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/15a1d811-261f-4ca0-b8f6-8282a5de40bd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.