Opened 17 years ago
Closed 17 years ago
#5488 closed (fixed)
newforms-admin: inline fields with multiple fk's between models doesn't work
Reported by: | jdetaeye | Owned by: | jdetaeye |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | newforms-admin: inline | |
Cc: | jdetaeye@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In case a single foreign key relation exists between the inline model and its parent, all is fine.
When there are multiple keys between the models, the InlineModelAdmin class provides the field fk_name in which we can define which one to use.
The required lookup when the fk_name is specified has not been coded yet: forgotten or skipped-for-now.
The attached patch provides the implementation.
Attachments (1)
Change History (6)
by , 17 years ago
Attachment: | newforms_admin_inline.patch added |
---|
comment:1 by , 17 years ago
The real changes in the patch are in lines 326-333 only.
Changes in other lines are trailing spaces removed by my source editor...
comment:2 by , 17 years ago
Do you really mean this does not need tests? :-) I'd like to supply them, otherwise (if I manage to discover what's the new syntax for inline fields).
Oh, and would you please add your email to the ticket? It would be nice to be able to contact you directly. Thanks.
comment:3 by , 17 years ago
Cc: | added |
---|
if I manage to discover what's the new syntax for inline fields
I share your frustration.
Here's what I figured out:
class Child_Inline(admin.TabularInline): model = Child extra = 3 class Parent_admin(admin.ModelAdmin): inlines = [Child_Inline]
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
implementation patch