MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / __clause_element__

Method __clause_element__

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

Source from the content-addressed store, hash-verified

1673 return cloned
1674
1675 def __clause_element__(self):
1676 # ensure existing entity_namespace remains
1677 annotations = {"bundle": self, "entity_namespace": self}
1678 annotations.update(self._annotations)
1679
1680 plugin_subject = self.exprs[0]._propagate_attrs.get(
1681 "plugin_subject", self.entity
1682 )
1683 return (
1684 expression.ClauseList(
1685 _literal_as_text_role=roles.ColumnsClauseRole,
1686 group=False,
1687 *[e._annotations.get("bundle", e) for e in self.exprs],
1688 )
1689 ._annotate(annotations)
1690 ._set_propagate_attrs(
1691 # the Bundle *must* use the orm plugin no matter what. the
1692 # subject can be None but it's much better if it's not.
1693 {
1694 "compile_state_plugin": "orm",
1695 "plugin_subject": plugin_subject,
1696 }
1697 )
1698 )
1699
1700 @property
1701 def clauses(self):

Callers 9

clausesMethod · 0.95
_load_for_pathMethod · 0.95
__init__Method · 0.45
_collect_insert_commandsFunction · 0.45
_collect_update_commandsFunction · 0.45
_emit_lazyloadMethod · 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