A field that maps a name to a specified field type. Similar to a DictField, except the 'value' of each item must match the specified field type.
| 1085 | |
| 1086 | |
| 1087 | class MapField(DictField): |
| 1088 | """A field that maps a name to a specified field type. Similar to |
| 1089 | a DictField, except the 'value' of each item must match the specified |
| 1090 | field type. |
| 1091 | """ |
| 1092 | |
| 1093 | def __init__(self, field=None, *args, **kwargs): |
| 1094 | # XXX ValidationError raised outside the "validate" method. |
| 1095 | if not isinstance(field, BaseField): |
| 1096 | self.error("Argument to MapField constructor must be a valid field") |
| 1097 | super().__init__(field=field, *args, **kwargs) |
| 1098 | |
| 1099 | |
| 1100 | class ReferenceField(BaseField): |