I figured out how to get information about UserProfile to appear in my admin field thanks to some help from you guys. Now I want to come up with a way to correctly sort these fields. I'm near.
class EmployerProfileAdmin(UserAdmin):
inlines = [EmployerProfileInline, ]
def company(self):
return self.get_profile().company
company.admin_order_field = 'employerprofile'
list_display = ('username','first_name','last_name',company,'email','password',)
Let me sort the company field from my UserProfile (EmployerProfile), but I need to sort it according to the field in User. The user has a "joberprofile", but the entire object. How django can sort by this field? Can I overwrite it in the EmployerProfile class?
Thank!
source
share