Ok.. I am a noob to Python but work with PHP a lot.
Basically I am trying to figure out how to take an object — for example:
{key:value,key:value}
or
{key:[value,value,value],key2:value2}
and turn them into forms:
<input name="key" value="value">
<input name="key" value="value">
and
<input name="key[]" value="value">
<input name="key[]" value="value">
<input name="key[]" value="value">
<input name="key2" value="value2">
You can have a template with the structure of the html.
Then you can replace #key# and #value# for the real values.
Something similar for your second example.