Opened 8 years ago

Last modified 8 years ago

#28018 closed Bug

OneToOneField not working with inlineadmin — at Initial Version

Reported by: alex Owned by: nobody
Component: contrib.admin Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This class hierarchy doesn't work with inlineadmin:

class hierarchy:

models.py:
class d:

pass

class a:

d = models.OneToOneField(d, on_delete=models.CASCADE, related_name="host")

class b:

pass

class dInlineAdmin(admin.TabularInline):

model = d

# admin.py
@admin.register(b)
class bSpecializedAdmin(admin.ModelAdmin):

inlines = [

dInlineAdmin,

]

Error message:
<class 'x.admin.RequirementInlineAdmin'>: (admin.E202) 'x.Requirement' has no field named 'host'.

'host' is the related_name

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top