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)
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)
def __init__(self, min_value=None, max_value=None, **kwargs): self.min_value=min_value self.max_value=max_value BaseField.__init__(self,**kwargs)
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)