Eoghan Murray
2009-04-17 19:13:06 UTC
Here is a patch that converts the output of DOM.formContents to a dictionary.
This has been raised as a difficulty before [1] and has bitten me a
few times when trying to edit the return value of formContents before
converting it to a query string.
In this patch, the previous format of:
[['name1', 'name2', 'name2'], ['value1', 'value2', 'value3']]
becomes:
{'name1': ['value1'], 'name2': ['value2', 'value3'] }
i.e. values are always stored in lists even if there is only one value.
This is backwards incompatible, but I've also updated Base.queryString
so that it still works with the new format.
If it is accepted I can update docs & version history.
Eoghan
[1] http://groups.google.com/group/mochikit/browse_thread/thread/5d970041f1696b10/a5fa33325d639cf4
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---
This has been raised as a difficulty before [1] and has bitten me a
few times when trying to edit the return value of formContents before
converting it to a query string.
In this patch, the previous format of:
[['name1', 'name2', 'name2'], ['value1', 'value2', 'value3']]
becomes:
{'name1': ['value1'], 'name2': ['value2', 'value3'] }
i.e. values are always stored in lists even if there is only one value.
This is backwards incompatible, but I've also updated Base.queryString
so that it still works with the new format.
If it is accepted I can update docs & version history.
Eoghan
[1] http://groups.google.com/group/mochikit/browse_thread/thread/5d970041f1696b10/a5fa33325d639cf4
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com
To unsubscribe from this group, send email to mochikit+***@googlegroups.com
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---