MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/orm/properties.py:148–207  ·  view source on GitHub ↗
(
        self,
        column: _ORMColumnExprArgument[_T],
        *additional_columns: _ORMColumnExprArgument[Any],
        attribute_options: Optional[_AttributeOptions] = None,
        group: Optional[str] = None,
        deferred: bool = False,
        raiseload: bool = False,
        comparator_factory: Optional[Type[PropComparator[_T]]] = None,
        active_history: bool = False,
        default_scalar_value: Any = None,
        expire_on_flush: bool = True,
        info: Optional[_InfoType] = None,
        doc: Optional[str] = None,
        _instrument: bool = True,
        _assume_readonly_dc_attributes: bool = False,
    )

Source from the content-addressed store, hash-verified

146 )
147
148 def __init__(
149 self,
150 column: _ORMColumnExprArgument[_T],
151 *additional_columns: _ORMColumnExprArgument[Any],
152 attribute_options: Optional[_AttributeOptions] = None,
153 group: Optional[str] = None,
154 deferred: bool = False,
155 raiseload: bool = False,
156 comparator_factory: Optional[Type[PropComparator[_T]]] = None,
157 active_history: bool = False,
158 default_scalar_value: Any = None,
159 expire_on_flush: bool = True,
160 info: Optional[_InfoType] = None,
161 doc: Optional[str] = None,
162 _instrument: bool = True,
163 _assume_readonly_dc_attributes: bool = False,
164 ):
165 super().__init__(
166 attribute_options=attribute_options,
167 _assume_readonly_dc_attributes=_assume_readonly_dc_attributes,
168 )
169 columns = (column,) + additional_columns
170 self.columns = [
171 coercions.expect(roles.LabeledColumnExprRole, c) for c in columns
172 ]
173 self.group = group
174 self.deferred = deferred
175 self.raiseload = raiseload
176 self.instrument = _instrument
177 self.comparator_factory = (
178 comparator_factory
179 if comparator_factory is not None
180 else self.__class__.Comparator
181 )
182 self.active_history = active_history
183 self._default_scalar_value = default_scalar_value
184 self.expire_on_flush = expire_on_flush
185
186 if info is not None:
187 self.info.update(info)
188
189 if doc is not None:
190 self.doc = doc
191 else:
192 for col in reversed(self.columns):
193 doc = getattr(col, "doc", None)
194 if doc is not None:
195 self.doc = doc
196 break
197 else:
198 self.doc = None
199
200 util.set_creation_order(self)
201
202 self.strategy_key = (
203 ("deferred", self.deferred),
204 ("instrument", self.instrument),
205 )

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45
updateMethod · 0.45

Tested by

no test coverage detected