MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / __init__

Method __init__

mongoengine/fields.py:115–125  ·  view source on GitHub ↗

:param regex: (optional) A string pattern that will be applied during validation :param max_length: (optional) A max length that will be applied during validation :param min_length: (optional) A min length that will be applied during validation :param kwargs: Keyword

(self, regex=None, max_length=None, min_length=None, **kwargs)

Source from the content-addressed store, hash-verified

113 """A unicode string field."""
114
115 def __init__(self, regex=None, max_length=None, min_length=None, **kwargs):
116 """
117 :param regex: (optional) A string pattern that will be applied during validation
118 :param max_length: (optional) A max length that will be applied during validation
119 :param min_length: (optional) A min length that will be applied during validation
120 :param kwargs: Keyword arguments passed into the parent :class:`~mongoengine.BaseField`
121 """
122 self.regex = re.compile(regex) if regex else None
123 self.max_length = max_length
124 self.min_length = min_length
125 super().__init__(**kwargs)
126
127 def to_python(self, value):
128 if isinstance(value, str):

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected