MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / columns

Method columns

lib/sqlalchemy/orm/mapper.py:2474–2489  ·  view source on GitHub ↗

A collection of :class:`_schema.Column` or other scalar expression objects maintained by this :class:`_orm.Mapper`. The collection behaves the same as that of the ``c`` attribute on any :class:`_schema.Table` object, except that only those columns included in this ma

(self)

Source from the content-addressed store, hash-verified

2472
2473 @HasMemoized.memoized_attribute
2474 def columns(self) -> ReadOnlyColumnCollection[str, Column[Any]]:
2475 """A collection of :class:`_schema.Column` or other scalar expression
2476 objects maintained by this :class:`_orm.Mapper`.
2477
2478 The collection behaves the same as that of the ``c`` attribute on any
2479 :class:`_schema.Table` object, except that only those columns included
2480 in this mapping are present, and are keyed based on the attribute name
2481 defined in the mapping, not necessarily the ``key`` attribute of the
2482 :class:`_schema.Column` itself. Additionally, scalar expressions
2483 mapped by :func:`.column_property` are also present here.
2484
2485 This is a *read only* attribute determined during mapper construction.
2486 Behavior is undefined if directly modified.
2487
2488 """
2489 return self._columns.as_readonly()
2490
2491 @HasMemoized.memoized_attribute
2492 def c(self) -> ReadOnlyColumnCollection[str, Column[Any]]:

Callers 6

_get_columns_infoMethod · 0.45
_fetch_multi_columnsMethod · 0.45
get_columnsMethod · 0.45
get_columnsMethod · 0.45
test_cols_driver_colsMethod · 0.45

Calls 1

as_readonlyMethod · 0.45

Tested by 1

test_cols_driver_colsMethod · 0.36