Exemple #1
0
 def to_dict(self, validate=True, ignore=[], context={}):
     type_ = getattr(self, 'type', Undefined)
     if type_ is Undefined and 'data' in context:
         kwds = parse_shorthand_plus_data(self.field, context['data'])
     else:
         kwds = parse_shorthand(self.field)
     self._kwds.update(kwds)
     return super(Column, self).to_dict(validate=validate, ignore=ignore, context=context)
Exemple #2
0
 def to_dict(self, validate=True, ignore=(), context=None):
     type_ = getattr(self, 'type', Undefined)
     context = context or {}
     if not isinstance(self.field, six.string_types):
         # field is a RepeatSpec or similar; cannot infer type
         kwds = {}
     elif type_ is Undefined and 'data' in context:
         kwds = parse_shorthand_plus_data(self.field, context['data'])
     else:
         kwds = parse_shorthand(self.field)
     self._kwds.update(kwds)
     return super(Order, self).to_dict(validate=validate,
                                             ignore=ignore,
                                             context=context)