MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __clause_element__

Method __clause_element__

lib/sqlalchemy/orm/util.py:1694–1717  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1692 return cloned
1693
1694 def __clause_element__(self):
1695 # ensure existing entity_namespace remains
1696 annotations = {"bundle": self, "entity_namespace": self}
1697 annotations.update(self._annotations)
1698
1699 plugin_subject = self.exprs[0]._propagate_attrs.get(
1700 "plugin_subject", self.entity
1701 )
1702 return (
1703 expression.ClauseList(
1704 _literal_as_text_role=roles.ColumnsClauseRole,
1705 group=False,
1706 *[e._annotations.get("bundle", e) for e in self.exprs],
1707 )
1708 ._annotate(annotations)
1709 ._set_propagate_attrs(
1710 # the Bundle *must* use the orm plugin no matter what. the
1711 # subject can be None but it's much better if it's not.
1712 {
1713 "compile_state_plugin": "orm",
1714 "plugin_subject": plugin_subject,
1715 }
1716 )
1717 )
1718
1719 @property
1720 def clauses(self):

Callers 9

clausesMethod · 0.95
__init__Method · 0.45
_collect_insert_commandsFunction · 0.45
_collect_update_commandsFunction · 0.45
_emit_lazyloadMethod · 0.45
_load_for_pathMethod · 0.45
__init__Method · 0.45

Calls 4

updateMethod · 0.45
getMethod · 0.45
_set_propagate_attrsMethod · 0.45
_annotateMethod · 0.45

Tested by 1