Consider this new-food.html:
<form>
<h2>Food Name</h2>
<input type="text" name="food" value="%(foodname)s">
<h2>Sides:<h2>
<input type="checkbox" name="sides" value="with_salad"> With Salad
<input type="checkbox" name="sides" value="with_fries"> With Fries
<input type="submit">
</form>
On submit, it will create a food entity with these items saved ['apple', 'mango']
. What happens when we want to edit this entity? The %(foodname)s
will preserve the Food Name text field, but how do we preserve the checkbox fields uploading of the page, like this:
<input type="checkbox" name="sides" value="with_fries" checked> With Fries