#3706 closed Uncategorized (wontfix)
[patch] Support for nested/compound forms for newforms
Reported by: | Jeroen van Dongen <jeroen at jkwadraat.net> | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | dev |
Severity: | Normal | Keywords: | nested compound subforms superform formlist |
Cc: | joost@…, samdolan@…, woolford.thomas@…, German M. Bravo | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
The attached file contains a few classes to provide the ability to nest forms in forms.
See also http://groups.google.com/group/django-developers/t/b39ec8990e756b53.
Attachments (4)
Change History (15)
by , 18 years ago
Attachment: | superforms.py added |
---|
comment:1 by , 18 years ago
comment:2 by , 18 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
Have you looked at the FormSet code recently added to django.newforms.formsets in the newforms-admin branch?
comment:3 by , 17 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I am closing this ticket as support for this is already in newforms-admin in django.newforms.formsets.
comment:4 by , 16 years ago
Cc: | added |
---|
As I see it this is not at all like the FormSet. The FormSet is about multiple forms *of the same type*, while superform.py allow compound or nested forms. See the doctest code.
I believe this functionality is not yet present in Django. Please reopen if I am correct.
comment:5 by , 16 years ago
I confirm, form sets are something different.
I would vote for having the nested forms.
by , 14 years ago
Attachment: | superform.py added |
---|
Updated version to work w/1.2 (should work with all 1.0+).
comment:6 by , 14 years ago
Cc: | added |
---|
I updated this patch in response to a stack overflow question http://stackoverflow.com/questions/3114656/django-compound-nested-subforms. I removed the doctests, and added unittests (in my own "django-common" repository) that have ~90% coverage covering the different form combinations (ModelForms, multiple SubForms, and mixed Fields + SubForms). If this is something people are interested I can work up a patch that integrates the SubForm class into the Django core with accompanying unit tests/docs.
comment:7 by , 14 years ago
Cc: | added |
---|
I think that if people knew about this patch they would be VERY interrested. This could make complicated form creation far easier by removing the mix an math approach of putting a ton of tiny forms in a template and combining all the data manually in one's view.
by , 14 years ago
Attachment: | superform.2.py added |
---|
Removed a debug raise statement that slipped by.
comment:8 by , 14 years ago
Easy pickings: | unset |
---|---|
Resolution: | worksforme |
Severity: | → Normal |
Status: | closed → reopened |
Type: | → Uncategorized |
Still not reviewed.
comment:9 by , 14 years ago
Resolution: | → wontfix |
---|---|
Status: | reopened → closed |
It wasn't reviewed because the fundamental idea was rejected. If you think the idea should be reconsidered, you need to start a discussion on Django-dev, not just reopen the ticket.
comment:10 by , 13 years ago
UI/UX: | unset |
---|
Why not make a reusable app out of this patch and put it on PyPI and djangopackages.com? Wouldn't it make sense since the patch doesn't modify Django at all, just adds some classes.
comment:11 by , 12 years ago
Cc: | added |
---|
In the current state it's useable except for the FormList functionality. There's something wrong with it (see Known bugs in the attached file), but I've currently no time to hunt it down, has to wait 'till later this week.