Google AppEngine: Formulário de tratamento 'StructuredProperty' repetido
Como eu trabalho comndb.StructuredProperty (repetido = verdadeiro) propriedades quando se trata de projetar seus formulários e manipuladores? Considere este exemplo:
Eu tenho 3 ndb.Modelo tipos:SkilledPerson, deleEducaçãoe seu (trabalho)Experiência. Os dois últimos são tipos StructuredProperty de SkilledPerson.
class SkilledPerson(ndb.Model):
name = ndb.StringProperty()
birth = ndb.DateProperty()
education = ndb.StructuredProperty(Education, repeated = True)
experience = ndb.StructuredProperty(Experience, repeated = True)
class Education(ndb.Model):
institution = ndb.StringProperty()
certification = ndb.StringProperty()
start = ndb.DateProperty()
finish = ndb.DateProperty()
class Experience(ndb.Model):
job_title = ndb.StringProperty()
workplace = ndb.StringProperty()
start = ndb.DateProperty()
finish = ndb.DateProperty()
Como eu criaria um formulário para oPessoa qualificada entidade? Ele mostraria campos simples comonome enascimento (StringProperty e DateProperty). Além disso, ele deve exibir um 'grupo' de campos para oEducação eExperiência Propriedades StructuredProperty. Eu imagino que a forma seja algo como isto:
<form method="post">
<h2>Skilled Person Form</h2>
<label>Name<br>
<input type="text" name="name" value="{{name}}">
</label>
<label>Birth<br>
<input type="date" name="birth" value="{{birth}}">
</label>
<!-- Education form goes here -->
<!-- and Experience form goes here -->
<input type="submit">
</form>
Como incluo os grupos de campos para Educação e Experiência neste formulário?
Um exemploEducação Formato:
<form method="post">
<h2>Add Education</h2>
<label>Institution<br>
<input type="text" name="institution" value="{{institution}}">
</label>
<label>Certification<br>
<input type="text" name="certification" value="{{certification}}">
</label>
<label>Start<br>
<input type="date" name="start" value="{{start}}">
</label>
<label>Finish<br>
<input type="date" name="finish" value="{{finish}}">
</label>
<input type="submit">
</form>