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 8492967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:52:36+00:00 2026-06-10T22:52:36+00:00

My Django model is as follow: class Page(models.Model): title = models.CharField(max_length=200) class Section(models.Model): page_id

  • 0

My Django model is as follow:

class Page(models.Model):
    title = models.CharField(max_length=200)

class Section(models.Model):
    page_id = models.ForeignKey(Page)
    title = models.CharField(max_length=200)

class SubSection(models.Model):
    section_id = models.ForeignKey(Section)
    title = models.CharField(max_length=200)

And I’d like to add a new Page in django Admin with the possibility to add several Section in which I can add several SubSection.

I already succeed to create a page where we can add a Page in which we can add several Section but it asks only for the name of the Section and there is no possibility to add a SubSection in the same page.

I tried this:

class SectionInline(admin.TabularInline):
    model = Section
    extra = 3

class PageAdmin(admin.ModelAdmin):
    inlines = [SectionInline]

admin.site.register(Page, PageAdmin)

But I can not add SubSectionInline into SectionInline.

Is there a way to do this?

Thank you.

  • 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-06-10T22:52:38+00:00Added an answer on June 10, 2026 at 10:52 pm

    Unfortunately you can’t do this using standard django admin app.

    All django admin let you do is to add Page with many Sections.
    Maybe adding many SubSections in Sections adding page would do what you want?

    You need to add:

    class SubSectionInline(admin.TabularInline):
        model = SubSection
        extra = 3
    
    class SectionAdmin(admin.ModelAdmin):
        inlines = [SubSectionInline]
    
    admin.site.register(Section, SectionAdmin)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is a Django model I'm using. class Person(models.Model): surname = models.CharField(max_length=255, null=True, blank=True)
I currently have this chunk of model code: class Book(models.Model): title = models.CharField(max_length=100) num_pages
Suppose I have a Django model as follows: class Person(models.Model): first_name = models.CharField(max_length=50) last_name
Here is my Django model class author(models.Model): name = models.CharField('name',max_length=140) datamode = models.CharField(max_length=1, default='A',
I'm trying to follow the code from the django docs: class Person(models.Model): name =
Given a Django model likeso: from django.db import models class MyModel(models.Model): textfield = models.TextField()
If I have a Django model with a FileField e.g., class Probe(models.Model): name =
In a Django UserProfile model, I am trying to do the following: class UserProfile(models.Model):
I have a memoized Django model manager method as follows: class GroupManager(models.Manager): def get_for_user(self,
I'm constantly doing the following pattern in Django: class MyModel(models.Model): FOO = 1 BAR

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.