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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:09:00+00:00 2026-05-16T23:09:00+00:00

I have four models with the relationships Model PagetTemplate(models.Model): pass Model TextKey(models.Model): page_template =

  • 0

I have four models with the relationships

Model PagetTemplate(models.Model):
    pass

Model TextKey(models.Model):
    page_template = models.ForeignKey(PageTemplate, related_name='text_keys')


Model Page(models.Model):
    page_template = models.ForeignKey(Pagetemplate, related_name='pages')

Model Text(models.Model):
    key = models.ForeignKey(TextKey, related_name='text_fields')
    page = models.ForeignKey(Page, related_name='text_fields')

the relation is like this:

                            PageTemplate
                                /\
                               /  \
                              /    \
                       TextKey      Page
                              \    /
                               \  /
                                \/
                               Text

In the validation for page (In the clean method), I check that [key for key in page.page_template.text_keys] and [text_field.key for text_field in page.text_fields] match up so that all text keys are filled in my a text. The problem I am having is that at the time the clean is called, page.text_fields is empty. The admin code looks like.

class TextInline(admin.StackedInline):
    model = Text
    extra = 0

class PageAdmin(DebugModelAdmin):
    inlines = [TextInline]

admin.site.register(Page, PageAdmin)

I wrapped admin.ModelAdmin in a logging class and know that I have the information I need when ModelAdmin.add_view is called but is overriding this the right thing to do or is there some option/method that would be better to override that I’m missing?

  • 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-16T23:09:01+00:00Added an answer on May 16, 2026 at 11:09 pm

    Looking at S. Lott’s sagacious advice on various django related threads, I decided to write an app to do this myself instead of forcing the django admin to do something that it wasn’t meant to do. I would honestly just download a decent CMS for django but the ones that I can find either suck (their code is riddled with typechecking, indented with tabs, etc) or don’t work on 1.2, so i’m rolling my own.

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

Sidebar

Related Questions

Let's assume that I have following models: class ScoutBook(models.Model): troop = models.ForeignKey('Dictionary', limit_choices_to={'type' :
I have a four classes: class A(models.Model): field1 = models.BooleanField(default = True) class Meta:
I have four models in my models.py which are: models.py class Course(models.Model): course_code =
I have four models that are related to one another, the way I have
Let's say I have four tables: PAGE , USER , TAG , and PAGE-TAG
I have four models: User Award Badge GameWeek The associations are as follows: User
I have on master page four user controls which are binded to shared presenter.
I have a single HTML page where I need to have three jqm pages
I have four textfields that bind to the model key path. If a number
I'm using Mongoid, Devise and Rails 3.1. I have four models: Students, Teacher, Parents

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.