Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7573355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:09:41+00:00 2026-05-30T16:09:41+00:00

In brief, i’m trying to get Django Admin to render inlines for more than

  • 0

In brief, i’m trying to get Django Admin to render inlines for more than one relationship to self. Can it be done? How? Take the following untested *illustration*; Assuming it worked i’d go to admin portal, select person, and add children (sons/daughters) and students.

Model Example (models.py)

class Person(models.Model):
    name = models.CharField(max_length=400)
    parent = models.ForeignKey('self',related_name='children')
    teacher = models.ForeignKey('self',related_name='students')

Django Admin (admin.py)

class ChildrenInline(admin.TabularInline):
    model = Person
    fk_name = 'parent'

class StudentsInline(admin.TabularInline):
    model = Person
    fk_name = 'teacher'

class PersonAdmin(admin.ModelAdmin):
    inline = [ChildrenInline,StudentsInline]
    model = Person

admin.site.register(Person,PersonAdmin)

If the above code it technically correct i’ll need to figure out what’s going on.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:09:42+00:00Added an answer on May 30, 2026 at 4:09 pm

    You have a typo !

    inline = instead of plural inlines = like in the docs.

    I tested, it works with inlines = 🙂

    Also, kudos for posting the right code to reproduce !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Brief question What command can I use to make my DataSet refresh it's connection
I'll keep this brief. I am trying to keep a map between strings and
From some brief fiddling about, I find I get an error when overriding superclass
Brief: I'm fairly new to databases and currently have one with two tables for
Brief description of what i want my VBA to achieve: I'm trying to import
Can Anyone give me brief detail about the resources used in UDP HolePunching as
Can somebody quickly brief me on the advantages and disadvantages of ksoap and ruby
Brief background: I have two-step login page, which after step 1 sends one-time code
In brief... I'm trying to find a way to add some attributes to the
Can anybody provide a brief explanation of the differences between mongrel and mongrel cluster?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.