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