How do I handle value(s) from a html form which is using a repeated=True
property?
For example, I have this ndb.Model:
class Book(ndb.Model):
title = ndb.StringProperty()
genre = ndb.StringProperty(repeated = True)
With this form inside the new-book.html:
<form method="post">
Book Title: <input type="text" name="title">
Book Genre: <input type="text" name="genre">
<input type="submit">
</form>
Is it appropriate to use the type="text"
input? Do I ask users to "separate each genre with a comma", and then process this myself in the handler? What is the best practice for handling this type of property in html forms?
(I've asked a related question here about handling repeated StructuredProperty: Google AppEngine: Form handling 'repeated' StructuredProperty)