| 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): |