How to model schema for list of embedded dictionaires in python eve -


i have document user has 2 addresses such below. how create schema in python-eve?

also, how create api request allow user update zipcode. have repost entire document?

{    _id: "joe",    name: "joe bookreader",    addresses: [                 {                   street: "123 fake street",                   city: "faketon",                   state: "ma",                   zip: "12345"                 },                 {                   street: "1 other street",                   city: "boston",                   state: "ma",                   zip: "12345"                 }               ]  } 

as far schema goes, should trick (docs):

'addresses': {     'type': 'list',     'schema' {         'type': 'dict',         'schema': {             'street': {'type': 'string'},             'city': {'type': 'string'},             'state': {'type': 'string'},             'zip': {'type': 'string'}          }      }  } 

dot notation supported patch (update) requests, not on lists of documents. trickier, , hard in restful way. there's open ticket right now, not direct solution yet, afraid.


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -