예제 #1
0
파일: field.py 프로젝트: bdragon300/koifish
    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
예제 #2
0
파일: field.py 프로젝트: bdragon300/koifish
    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
예제 #3
0
 def setup(self):
     self.validator = validators.Model(User)
예제 #4
0
    def __init__(self, model, *args, **kwargs):
        super(Embedded, self).__init__(builtin_validators.Model(model), *args,
                                       **kwargs)

        self.model = model