Auth user model changes
Now supports custom User models in Django 1.5 and above.
Looks good to go! I'd love for this to be merged so i can use the 'official' version in my project instead of a fork... @tomchristie
It might still need a quick;
python manage.py schemamigration userroles --update --initial
as the migrations are not updated yet to reflect the other changes...
We need to do some thinking about the migrations. Is it actually possible to support all of the following cases?
- Project running Django<1.5 upgrades to new version of django-user-roles (nothing should change)
- Project running Django>=1.5 without custom user model upgrades to new version of django-user-roles (nothing should change)
- Project running Django>=1.5 with custom user model that wasn't previously using django-user-roles installs new version of django-user-roles (userroles_userrole table should be created with a foreign key to the custom user model)
- Project running Django<1.5 that was previously using django-user-roles upgrades to new version of django-user-roles and at the same time changes to a custom user model (what the hell should happen here?)
This StackOverflow question might be useful: http://stackoverflow.com/questions/15472704/trouble-migrating-reusable-django-app-models-to-use-a-custom-user-model
Perhaps we should leave complex cases to the user - just document using the SOUTH_MIGRATION_MODULES setting to add a custom location for migrations for django-user-roles that point at your custom user model?
i think you can only go so far in supporting all of these. if you've already run the migration nothing will happen if you upgrade django-user-roles which is probably what you want anyway. if your moving to a custom user model it's your own responsibility to make a data migration that makes sense i would think...