django-relationships
django-relationships copied to clipboard
Django 1.5 CustomUser.first_name and Admin
It appears to be that you are using the field first_name for displaying the relationships on the admin but there is no guarranty that a CustomUser would have this field. I think the only field that would be there for sure is USERNAME_FIELD [get_username()]. I'm pretty new with Django so please correct me if I'm wrong.
Similar problem, I have a custom user model and I get this error: 'username' is not a callable or an attribute of 'UserRelationshipAdmin' or found in the model 'MyCustomUser'. Evidently I don't have a 'username' field in my custom user model, I have an email defined as USERNAME_FIELD in the model instead
EDIT: I think the problem is in admin.py when importing from django.contrib.auth.admin import UserAdmin The UserAdmin is using the fields for the built-in User model, and when registering: admin.site.register(User, UserRelationshipAdmin) we have the error, instead of importing UserAdmin we should be able to import the custom user admin, I'm also pretty new to django so I couldn't find a solution yet.
Did any of you fixed this problem?
I've moved to django-friendship. A workaround would be to unregister django-relationship from the admin.