models.py
{{{
class Person(models.Model):
pname = models.CharField("Name",max_length=100)
father = models.ForeignKey("familytree.Person",
on_delete=models.CASCADE,null=True, blank=True, editable=False)
def __str__(self):
return self.pname
}}}
admin.py
{{{
class PersonInline(admin.TabularInline):
model: Person
fields = ['pname',]
extra: 3
class PersonAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['pname']}),
]
inlines: (PersonInline)
admin.site.register(Person, PersonAdmin)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33869>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "0eGzOPqZV7.png" added.
Admin View
* status: new => closed
* resolution: => invalid
Comment:
It looks like you forgot a comma:
{{{
inlines: (PersonInline,)
}}}
For the future, please don't use Trac as a support channel. Closing per
TicketClosingReasons/UseSupportChannels.
--
Ticket URL: <https://code.djangoproject.com/ticket/33869#comment:1>