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


Python collection.removes方法代碼示例

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


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

示例1: removes

# 需要導入模塊: from sqlalchemy.orm.collections import collection [as 別名]
# 或者: from sqlalchemy.orm.collections.collection import removes [as 別名]
def removes(arg):
        """Mark the method as removing an entity in the collection.

        Adds "remove from collection" handling to the method.  The decorator
        argument indicates which method argument holds the SQLAlchemy-relevant
        value to be removed. Arguments can be specified positionally (i.e.
        integer) or by name::

            @collection.removes(1)
            def zap(self, item): ...

        For methods where the value to remove is not known at call-time, use
        collection.removes_return.

        """
        def decorator(fn):
            fn._sa_instrument_before = ('fire_remove_event', arg)
            return fn
        return decorator 
開發者ID:jpush,項目名稱:jbox,代碼行數:21,代碼來源:collections.py

示例2: removes

# 需要導入模塊: from sqlalchemy.orm.collections import collection [as 別名]
# 或者: from sqlalchemy.orm.collections.collection import removes [as 別名]
def removes(arg):
        """Mark the method as removing an entity in the collection.

        Adds "remove from collection" handling to the method.  The decorator
        argument indicates which method argument holds the SQLAlchemy-relevant
        value to be removed. Arguments can be specified positionally (i.e.
        integer) or by name::

            @collection.removes(1)
            def zap(self, item): ...

        For methods where the value to remove is not known at call-time, use
        collection.removes_return.

        """

        def decorator(fn):
            fn._sa_instrument_before = ("fire_remove_event", arg)
            return fn

        return decorator 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:23,代碼來源:collections.py


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