本文整理匯總了Python中sqlalchemy.sql.functions.GenericFunction.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python GenericFunction.__init__方法的具體用法?Python GenericFunction.__init__怎麽用?Python GenericFunction.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sqlalchemy.sql.functions.GenericFunction
的用法示例。
在下文中一共展示了GenericFunction.__init__方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from sqlalchemy.sql.functions import GenericFunction [as 別名]
# 或者: from sqlalchemy.sql.functions.GenericFunction import __init__ [as 別名]
def __init__(cls, clsname, bases, clsdict):
if annotation.Annotated not in cls.__mro__:
cls.name = name = clsdict.get("name", clsname)
cls.identifier = identifier = clsdict.get("identifier", name)
package = clsdict.pop("package", "_default")
# legacy
if "__return_type__" in clsdict:
cls.type = clsdict["__return_type__"]
# Check _register attribute status
cls._register = getattr(cls, "_register", True)
# Register the function if required
if cls._register:
register_function(identifier, cls, package)
else:
# Set _register to True to register child classes by default
cls._register = True
super(_GenericMeta, cls).__init__(clsname, bases, clsdict)
示例2: __init__
# 需要導入模塊: from sqlalchemy.sql.functions import GenericFunction [as 別名]
# 或者: from sqlalchemy.sql.functions.GenericFunction import __init__ [as 別名]
def __init__(self, *clauses, **kwargs):
"""Construct a :class:`.FunctionElement`.
"""
args = [_literal_as_binds(c, self.name) for c in clauses]
self.clause_expr = ClauseList(
operator=operators.comma_op,
group_contents=True, *args).\
self_group()