I have model as
class Employer(models.Model):
create_user = models.ForeignKey(User,unique=False,null=True, related_name=\'%(class)s_user_create\')
updat
The particular error you mention doesn't seem to have anything to do with what's going on in your code, so I'm not sure about that particularly. However, you have other errors here, so potentially fixing those will resolve that error as well.
First, you need to specify fk_name
on your EmployerInline
. Django resolves the foreign key automatically in most circumstances, but since you have two foreign keys to the same model, you have to give Django some help.
class EmployerInline(admin.TabularInline):
model = Employer
fk_name = 'create_user'
Second, you may have just omitted it, but you must unregister User
before registering it. You also need to specify the model when registering:
admin.site.unregister(User)
admin.site.register(User, UserAdmin)