def __init__(self, verbose_name=None, mongo_name=None, min_length=None, max_length=None, **kwargs): """ :parameters: - `verbose_name`: A human-readable name for the Field. - `mongo_name`: The name of this field when stored in MongoDB. - `min_length`: The required minimum length of the string. - `max_length`: The required maximum length of the string. .. seealso:: constructor for :class:`~pymodm.base.fields.MongoBaseField` """ super(CharField, self).__init__(verbose_name=verbose_name, mongo_name=mongo_name, **kwargs) self.max_length = max_length self.validators.append( validators.validator_for_length(min_length, max_length))
def __init__(self, verbose_name=None, mongo_name=None, min_length=None, max_length=None, **kwargs): """ :parameters: - `verbose_name`: A human-readable name for the Field. - `mongo_name`: The name of this field when stored in MongoDB. - `min_length`: The required minimum length of the string. - `max_length`: The required maximum length of the string. .. seealso:: constructor for :class:`~pymodm.base.fields.MongoBaseField` """ super(CharField, self).__init__(verbose_name=verbose_name, mongo_name=mongo_name, **kwargs) self.max_length = max_length self.validators.append( validators.validator_for_length(min_length, max_length))