當前位置: 首頁>>代碼示例>>Python>>正文


Python expression._truncated_label方法代碼示例

本文整理匯總了Python中sqlalchemy.sql.expression._truncated_label方法的典型用法代碼示例。如果您正苦於以下問題:Python expression._truncated_label方法的具體用法?Python expression._truncated_label怎麽用?Python expression._truncated_label使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sqlalchemy.sql.expression的用法示例。


在下文中一共展示了expression._truncated_label方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: visit_alias

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _truncated_label [as 別名]
def visit_alias(self, alias, asfrom=False, **kwargs):
        if self.dialect._version_two:
            return super(FBCompiler, self).\
                visit_alias(alias, asfrom=asfrom, **kwargs)
        else:
            # Override to not use the AS keyword which FB 1.5 does not like
            if asfrom:
                alias_name = isinstance(alias.name,
                                        expression._truncated_label) and \
                    self._truncated_identifier("alias",
                                               alias.name) or alias.name

                return self.process(
                    alias.original, asfrom=asfrom, **kwargs) + \
                    " " + \
                    self.preparer.format_alias(alias, alias_name)
            else:
                return self.process(alias.original, **kwargs) 
開發者ID:jpush,項目名稱:jbox,代碼行數:20,代碼來源:base.py

示例2: visit_alias

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _truncated_label [as 別名]
def visit_alias(self, alias, asfrom=False, ashint=False, **kwargs):
        """Oracle doesn't like ``FROM table AS alias``.  Is the AS standard
        SQL??
        """

        if asfrom or ashint:
            alias_name = isinstance(alias.name, expression._truncated_label) and \
                self._truncated_identifier("alias", alias.name) or alias.name

        if ashint:
            return alias_name
        elif asfrom:
            return self.process(alias.original, asfrom=asfrom, **kwargs) + \
                " " + self.preparer.format_alias(alias, alias_name)
        else:
            return self.process(alias.original, **kwargs) 
開發者ID:gltn,項目名稱:stdm,代碼行數:18,代碼來源:base.py

示例3: visit_alias

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _truncated_label [as 別名]
def visit_alias(self, alias, asfrom=False, **kwargs):
        if self.dialect._version_two:
            return super(FBCompiler, self).visit_alias(
                alias, asfrom=asfrom, **kwargs
            )
        else:
            # Override to not use the AS keyword which FB 1.5 does not like
            if asfrom:
                alias_name = (
                    isinstance(alias.name, expression._truncated_label)
                    and self._truncated_identifier("alias", alias.name)
                    or alias.name
                )

                return (
                    self.process(alias.element, asfrom=asfrom, **kwargs)
                    + " "
                    + self.preparer.format_alias(alias, alias_name)
                )
            else:
                return self.process(alias.element, **kwargs) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:23,代碼來源:base.py

示例4: visit_alias

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _truncated_label [as 別名]
def visit_alias(self, alias, asfrom=False, **kwargs):
        if self.dialect._version_two:
            return super(FBCompiler, self).\
                        visit_alias(alias, asfrom=asfrom, **kwargs)
        else:
            # Override to not use the AS keyword which FB 1.5 does not like
            if asfrom:
                alias_name = isinstance(alias.name,
                                expression._truncated_label) and \
                                self._truncated_identifier("alias",
                                alias.name) or alias.name

                return self.process(
                            alias.original, asfrom=asfrom, **kwargs) + \
                            " " + \
                            self.preparer.format_alias(alias, alias_name)
            else:
                return self.process(alias.original, **kwargs) 
開發者ID:binhex,項目名稱:moviegrabber,代碼行數:20,代碼來源:base.py

示例5: visit_alias

# 需要導入模塊: from sqlalchemy.sql import expression [as 別名]
# 或者: from sqlalchemy.sql.expression import _truncated_label [as 別名]
def visit_alias(self, alias, asfrom=False, ashint=False, **kwargs):
        """Oracle doesn't like ``FROM table AS alias``.  Is the AS standard SQL??"""

        if asfrom or ashint:
            alias_name = isinstance(alias.name, expression._truncated_label) and \
                            self._truncated_identifier("alias", alias.name) or alias.name

        if ashint:
            return alias_name
        elif asfrom:
            return self.process(alias.original, asfrom=asfrom, **kwargs) + \
                            " " + self.preparer.format_alias(alias, alias_name)
        else:
            return self.process(alias.original, **kwargs) 
開發者ID:binhex,項目名稱:moviegrabber,代碼行數:16,代碼來源:base.py


注:本文中的sqlalchemy.sql.expression._truncated_label方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。