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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:54:20+00:00 2026-05-11T03:54:20+00:00

I am working through the examples in a Django book that I have, but

  • 0

I am working through the examples in a Django book that I have, but the book was written for 0.96 and I am using 1.0.2, yeah, I know, not the best idea. But reading Django’s ‘porting your apps from 0.96 to 1.0’ doc has cleared up most of the differences for me. Until I get to the point where I need to implement inline editing of a second model on the admin page.

I am using a custom keyword search model to allow you to search pages made using Django’s Flatpages app. Below is the model:

class SearchKeyword(models.Model):

    keyword = models.CharField(max_length=50, blank=True)     page = models.ForeignKey(FlatPage)      def __unicode__(self):         return self.keyword 

What should my admin.py look like to set up a StackedInline for SearchKeyword that shows up on the Flatpages admin page?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T03:54:20+00:00Added an answer on May 11, 2026 at 3:54 am

    You can do something like this:

    class SearchKeywordInline(admin.StackedInline):     model = SearchKeyword     extra = 3  class FlatPageAdmin(admin.ModelAdmin):     inlines = [SearchKeywordInline]  # unregister the FlatPage model from the admin site so I can # register it again with the inline stuff (Thanks Carl & Jason) admin.site.unregister(FlatPage) admin.site.register(FlatPage, FlatPageAdmin) 

    More info in the official Django docs

    Update: Fixed the code to suit your requirements.

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

Sidebar

Related Questions

I have been working through the asio ssl examples (linked below). Despite by best
I am working through some examples in a WCF book. There is a Host
I am new to python and have been working through the examples in Swaroop
What are the best examples of real life protocols that tunnel through HTTP? XMPP/Jabber?
Working through more book examples- this one is a partial poker program- This segment
I am working through a book which gives examples of Ranges being converted to
I've been working through some examples in The C Programming Language by K&R, but
I'm working through examples in a book trying to learn ASP.NET, and I've stumbled
I have been working through some of the examples of MVVM & WPF and
I'm working through examples in the book 'Visual Quick Start, Objective-C' by Holzner. I

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.