def __init__(self, model, *args, **kwargs): kwargs.setdefault('encoders', []).append(builtin_encoders.Model()) kwargs.setdefault('decoders', []).append(builtin_decoders.Model(model)) super(EmbeddedField, self).__init__(builtin_validators.Model(model), *args, **kwargs) self.model = model
def __init__(self, model, *args, **kwargs): kwargs.setdefault('default', []) kwargs.setdefault('encoders', []).append(builtin_encoders.Collection()) kwargs.setdefault('decoders', []).append(builtin_decoders.Collection(model)) super(CollectionField, self).__init__( builtin_validators.List(builtin_validators.Model(model)), *args, **kwargs) self.model = model
def setup(self): self.validator = validators.Model(User)
def __init__(self, model, *args, **kwargs): super(Embedded, self).__init__(builtin_validators.Model(model), *args, **kwargs) self.model = model