﻿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
26502	Lookup of attribute 'id' on model inheritance models in InlineModelAdmin fails when using fk_name of parent model	Waldemar Hamm	nobody	"Having two models, of which one inherits from another, for example:

{{{
class Person(models.Model):
    firstname = models.CharField(max_length=255, blank=True)
    lastname = models.CharField(max_length=255)
    person_something = models.ForeignKey(Something)

class Author(Person):
    publisher = models.CharField(max_length=255)
    author_something = models.ForeignKey(Something)
}}}

I can't access the id field like so:

{{{
class AuthorInline(admin.StackedInline):
    model = Author
    fk_name = 'person_something'
    fields = ['id', 'lastname', 'publisher']
    readonly_fields = fields

class SomethingAdmin(admin.ModelAdmin):
    inlines = [ AuthorInline ]
    list_display = ('somethinga', 'somethingb')
}}}

I get a KeyError and it says:
""Key 'id' not found in 'AuthorForm'""

Using Author._meta.get_all_field_names() the field id is definitely in the model, though. Removing 'id' from the fields list makes everything work. 

Am I doing something wrong or is this a legit bug?"	Uncategorized	closed	Forms	1.8	Normal	invalid	id, model inheritance, inherited model, inline		Unreviewed	0	0	0	0	0	0
