﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8241	Primary ForeignKeys don't work with FormSets	Samuel Cormier-Iijima	Brian Rosner	"Using this UserProfile as an example:

{{{

class UserProfile(models.Model):
    user = models.OneToOneField(primary_key=True)
    nickname = models.CharField(max_length=30)

from django.contrib.auth.models import User
from django.contrib.auth.admin import UserAdmin
from django.contrib.admin import site, StackedInline

class UserProfileAdmin(StackedInline)
    model = UserProfile
    max_num = 1

UserAdmin.inlines = UserAdmin.inlines + [UserProfileAdmin]

site.unregister(User)
site.register(User, UserAdmin)

}}}

Trying to save a User from the admin causes a KeyError: 'user_id' because the primary key doesn't get rendered in the form."		closed	contrib.admin	dev		fixed		sciyoshi@… ville@…	Accepted	1	0	1	0	0	0
