Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Admin inline for inherited model cant find pointer to parent model
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Demetrio Girardi  
View profile  
 More options Feb 13, 4:43 am
From: Demetrio Girardi <demetrio.gira...@gmail.com>
Date: Mon, 13 Feb 2012 10:43:58 +0100
Local: Mon, Feb 13 2012 4:43 am
Subject: Admin inline for inherited model cant find pointer to parent model
I have a child model that I wish edit inline in the admin site. When
trying to save edits I get a MultiValueDictKeyError:

"Key 'childmodel_set-0-parentmodel_ptr' not found in <QueryDict: ..>"

It seems to me the admin is trying to get the reference to the parent
model from the form data. How can I fix this? Do I need a custom form?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Demetrio Girardi  
View profile  
 More options Feb 13, 5:44 am
From: Demetrio Girardi <demetrio.gira...@gmail.com>
Date: Mon, 13 Feb 2012 11:44:46 +0100
Local: Mon, Feb 13 2012 5:44 am
Subject: Re: Admin inline for inherited model cant find pointer to parent model
Looking more into this,

my parent model has a primary key field named 'code'. The inline forms
do show the 'code' field for the child model instances, and the data
is in the formset's querydict:
QueryDict <... u'childmodel_set-0-code': [u'...'] ...>

However the table column name for the one-to-one relationship between
parent and child is called 'parendmodel__ptr__id', and the admin is
looking for 'childmodel_set-0-parentmodel_ptr' in the formset data.
Why?

On Mon, Feb 13, 2012 at 10:43 AM, Demetrio Girardi


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »