Closed 3dw1np closed 5 years ago
I am trying to extend a nested schema definition inside a list:
`
t = Schema({ ... 'delivery_addresses': All([{ ... Required('name'): unicode ... }]) ... }) t = t.extend({ ... Required('delivery_addresses'): [{ ... Required('geohash'): unicode ... }] ... }) print(t) {u'delivery_addresses': [{u'geohash': <type 'unicode'>}]} `
t = Schema({ ... 'delivery_addresses': All([{ ... Required('name'): unicode ... }]) ... })
t = t.extend({ ... Required('delivery_addresses'): [{ ... Required('geohash'): unicode ... }] ... })
print(t) {u'delivery_addresses': [{u'geohash': <type 'unicode'>}]} `
But as you can see, it's not merging the dict definition, it's replacing.
You can only replace or add keys.
I am trying to extend a nested schema definition inside a list:
`
But as you can see, it's not merging the dict definition, it's replacing.