#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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701823ed21019-a2fe0a18-4b3d-40ba-a58e-8214ea0579e2-000000%40eu-central-1.amazonses.com.