I updated my django 1.4 application with user profiles to use 1.5 Custom User Model.
#core/models.py
from django.contrib.auth.models import User, UserManager, BaseUserManager, AbstractUser
class MyUserManager(BaseUserManager):
pass
class MyUser(AbstractUser):
phone = models.CharField(blank = True, max_length = 18)
completed_step = models.IntegerField(default = 0)
objects = MyUserManager()
I wrote schema migrations for south and all data was imported successfully.
Otherwise, I have a problem with auth_group and auth_permision. Django can't generate any additional tables, but when I want to get permissions or groups I have this SQL with JOIN to additional table:
SELECT ...
FROM "core_myuser"
WHERE "core_myuser"."id" = 61 (8ms) Found 1 matching rows
SELECT ...
FROM "core_myuser"
WHERE "core_myuser"."id" = 363 (1ms) Found 1 matching rows
SELECT ...
FROM "auth_group"
INNER JOIN "core_myuser_groups" ON ("auth_group"."id" = "core_myuser_groups"."group_id")
WHERE "core_myuser_groups"."myuser_id" = 363
With Internal Server Error