Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

id of the root form gets added to form parameters #39

Open
amol- opened this issue Jun 25, 2012 · 2 comments
Open

id of the root form gets added to form parameters #39

amol- opened this issue Jun 25, 2012 · 2 comments

Comments

@amol-
Copy link
Contributor

amol- commented Jun 25, 2012

class MovieForm(TableForm):
   #id = 'movieform'
   title = TextField()
   year = TextField()

Reported by @Cito

Submitting this form results in title and year values, but if we decomment the #id line the submitted values will be movieform:title and movieform:year. While this behavior makes sense for nested forms or fieldsets and was already there for those on TW1, in case of the root form probably the id shouldn't be added to field names.

@ralphbean
Copy link
Contributor

Note to self -> next step is to write, commit, and push one or two failing unit tests that demonstrate this.

@ralphbean
Copy link
Contributor

This is pretty hairy. I think it would be simple to check if "my parent has no parent, don't use my parent's id for my compound_id". But MovieForm doesn't actually have title and year as children. It has a TableLayout as a child, and that TableLayout has title and year as children. The id of both MovieForm and TableLayout is movieform which makes things strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants