Opened 17 years ago

Last modified 9 months ago

#4848 new New feature

Allow inline fields to be "mixed in" with the models' own fields

Reported by: leifbyron Owned by: nobody
Component: contrib.admin Version: newforms-admin
Severity: Normal Keywords: nfa-someday newforms-admin inline models fields
Cc: ckesselh, gezuru@…, andreas@…, Frank Sachsenheim, Alex Scott Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In newforms-admin, it would be quite helpful to be able to specify both a models' fields and its inline models' fields in the fields tuple of the options class. This would allow inline model fields to be "mixed in" with the models' own fields on the model's admin page. There are many situations where this would be preferable to the current situation -- always having inline model fields rendered below the models' own fields.

I suggested this feature in the Django-developers group, and Adrian suggested that I open a ticket.

http://groups.google.com/group/django-developers/browse_thread/thread/c54d026eb46ad375/93bebf102281bb41#93bebf102281bb41

Change History (17)

comment:1 by anonymous, 17 years ago

Yes, I recently stumbled across that missing feature and I agree that it would be highly desirable. --lupo

comment:2 by jkocherhans, 17 years ago

Triage Stage: UnreviewedAccepted

I'd rather come up with some way of naming each inline and using those names in the fields or fieldsets, but allowing inline forms to be placed in the middle of other form fields would be a great feature.

comment:3 by Brian Rosner, 17 years ago

Keywords: nfa-someday added

This can be written backward compatible after the merge of newforms-admin.

comment:4 by Brian Rosner, 16 years ago

milestone: post-1.0

comment:5 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:6 by mlindsey, 14 years ago

I would also like to see this feature.

comment:7 by Ramiro Morales, 14 years ago

#14491 asked for the possibility to intermix inlines with fieldsets and was closed as duplicate of this ticket.

comment:8 by Gabriel Hurley, 14 years ago

Severity: Normal
Type: New feature

comment:9 by ckesselh, 13 years ago

Cc: ckesselh added
Easy pickings: unset
UI/UX: unset

comment:10 by gezuru@…, 13 years ago

Cc: gezuru@… added

comment:11 by Collin Anderson, 10 years ago

Summary: Feature Proposal: Allowing inline fields to be specified in the fields tuple (newforms-admin)Allow inline fields to be "mixed in" with the models' own fields

comment:12 by Andreas Nüßlein, 9 years ago

Cc: andreas@… added

comment:13 by Karolis Ryselis, 7 years ago

Is this still relevant? My vision on this is to promote inlines to fieldsets. It could look like this in admin class:

fieldsets = (
    ("Normal fieldset", {"fields": ("main_model_field1", "main_model_field2")}),
    ("Related inline fieldset", {"inline_class": RelatedModelInline})
)

We could keep the current inlines attribute for backwards compatibility and add those inlines as last fieldsets to the form. Getting inlines for form submission would require checking fieldsets instead of inlines.

I could implement this feature.

comment:14 by Frank Sachsenheim, 6 years ago

Cc: Frank Sachsenheim added

@Karolis, i think the proposal formulated by @jkocherhans is more flexible as it allows multiple inlines mxied with fields within a fieldset.

comment:15 by Alex Scott, 5 years ago

Cc: Alex Scott added

Is anyone working on this?

One "solution" that I found:
https://github.com/dezede/dezede/commit/ed13ccaf34494e71fd913fd785c229052f6acdc8

Another:
https://linevi.ch/en/django-inline-in-fieldset.html

I've never contributed before but if some would weigh in on what they think the cleanest solution would be, I could maybe attempt something.

comment:16 by frnhr, 5 years ago

A similar feature was asked for in #15859, closed as a duplicate of this ticket.

comment:17 by frnhr, 9 months ago

There seems to be a working app for this: https://github.com/robertkovac/django-fieldsets-with-inlines
I would love to see it built in.

Note: See TracTickets for help on using tickets.
Back to Top