﻿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
22954	Admin OneToOneField not shown on other side	m@…	nobody	"There are 2 models, Document and Episode. Episode has a OneToOneField to Document. When both are added to the admin-site, the relation shows up on Episode, but not on Document. Explicitly adding the field explicitly yields an ""Unknown field""-exception.
Accessing the episode-attribute of Document in the code works just fine, of course.
This is the case in both 1.6 and 1.7.


Models:
{{{#!python
from django.db import models

class Document(models.Model):
    pass

class Episode(models.Model):
    document = models.OneToOneField(Document, related_name='episode')
}}}

Admin:
{{{#!python
from django.contrib import admin

from .models import *

class EpisodeAdmin(admin.ModelAdmin):
    pass

class DocumentAdmin(admin.ModelAdmin):
    fields = ('episode',)

admin.site.register(Episode, EpisodeAdmin)
admin.site.register(Document, DocumentAdmin)
}}}"	Uncategorized	closed	contrib.admin	1.6	Normal	invalid	admin, onetoone, one to one, relation, field	luto	Unreviewed	0	0	0	0	0	0
