Here is a model in Django:
class Member(models.Model):
user = models.OneToOneField(User)
moredata = models.CharField('More data', max_length=255)
I want to put all the user fields in that model's edit/create page in the Django admin. So I did this:
class UserInline(admin.StackedInline):
model = User
class MemberAdmin(admin.ModelAdmin):
inlines = [
UserInline,
]
admin.site.register(Member, MemberAdmin)
But Django says that there are no foreign keys to Member on User, which is completely true. Is there a way to fix this?
If I don't use the admin class, all I get is a list of users to pick from.
Ideally, I'd like the User type to be invisible to administrators and have them only create and edit derived User types.
Instead of a OneToOne relation, should I be extending the actual User type instead?
editable=False? And what's wrong with the default widget? - yuvi