Skip to content

Conversation

@witsch
Copy link

@witsch witsch commented Jan 19, 2011

hi :),

we've been working with formish in a project that also makes heavy of javascript. in some forms elements can be reordered by drag & drop, after which sequential fields (e.g. set up with schemaish.Sequence(schemaish.Integer())) break during validation. the problem here is that the POST data doesn't yield the various .nn-suffixed items in ascending order, as expected by dottedish's unflatten method.

it'd be great if you considered pulling in the change i've made and perhaps also making a new release. that way we wouldn't need to maintain another private egg in this project… :)

cheers,

andi

@atomatt
Copy link
Collaborator

atomatt commented Jan 20, 2011

Hi, thanks for the patch. Unfortunately, I don't think this will work because the sort is lexicographic so as soon as you get more than 10 items in a sequence the sort will order the keys to foo.0, foo.1, foo.10, foo.2, etc and cause an IndexError for foo.10.

Now, formish should be renumbering the sequence fields to ensure they're POST'ed in ascending order so perhaps you've found a bug in formish?

  • Matt

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

Successfully merging this pull request may close these issues.

2 participants