[Django] #33869: Self Reference Inlines is not working form me

6 views
Skip to first unread message

Django

unread,
Jul 27, 2022, 4:42:13 AM7/27/22
to django-...@googlegroups.com
#33869: Self Reference Inlines is not working form me
-----------------------------------------+------------------------
Reporter: aelhofy | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
I created a simple Self Reference model for a family tree and when added
inlines to the model it is not working , code below:

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.

Django

unread,
Jul 27, 2022, 4:44:26 AM7/27/22
to django-...@googlegroups.com
#33869: Self Reference Inlines is not working form me
-------------------------------+--------------------------------------

Reporter: aelhofy | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 4.0
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by aelhofy):

* Attachment "0eGzOPqZV7.png" added.

Admin View

Django

unread,
Jul 27, 2022, 4:47:39 AM7/27/22
to django-...@googlegroups.com
#33869: Self Reference Inlines is not working form me
-------------------------------+--------------------------------------
Reporter: aelhofy | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 4.0
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

* 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>

Reply all
Reply to author
Forward
0 new messages