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.
Change History (17)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
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 , 17 years ago
Keywords: | nfa-someday added |
---|
This can be written backward compatible after the merge of newforms-admin.
comment:4 by , 16 years ago
milestone: | → post-1.0 |
---|
comment:7 by , 14 years ago
#14491 asked for the possibility to intermix inlines with fieldsets and was closed as duplicate of this ticket.
comment:8 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:9 by , 13 years ago
Cc: | added |
---|---|
Easy pickings: | unset |
UI/UX: | unset |
comment:10 by , 13 years ago
Cc: | added |
---|
comment:11 by , 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 , 9 years ago
Cc: | added |
---|
comment:13 by , 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 , 6 years ago
Cc: | 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 , 5 years ago
Cc: | 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 , 5 years ago
A similar feature was asked for in #15859, closed as a duplicate of this ticket.
comment:17 by , 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.
Yes, I recently stumbled across that missing feature and I agree that it would be highly desirable. --lupo