예제 #1
0
 def __init__(self, field, **kwargs):
     if not isinstance(field,BaseField):
         raise ValueError(str(field)+" is not subclass of BaseField")
     self.field=field
     BaseField.__init__(self,**kwargs)
예제 #2
0
    def __init__(self, regex=None, max_length=None, **kwargs):
        self.regex=re.compile(regex) if regex else None
        self.max_length=max_length

        BaseField.__init__(self,**kwargs)
예제 #3
0
 def __init__(self, min_value=None, max_value=None, **kwargs):
     self.min_value=min_value
     self.max_value=max_value
     BaseField.__init__(self,**kwargs)
예제 #4
0
 def __init__(self, document_cls, **kwargs):
     if not issubclass(document_cls,Model):
         raise ValueError(str(document_cls)+" is not Model")
     self.document_type=document_cls
     BaseField.__init__(**kwargs)