Python sqlalchemy.orm.collections.collection.removes() Examples

The following are 9 code examples of sqlalchemy.orm.collections.collection.removes(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module sqlalchemy.orm.collections.collection , or try the search function .
Example #1
Source File: collections.py    From jbox with MIT License 6 votes vote down vote up
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 
Example #2
Source File: collections.py    From Fluid-Designer with GNU General Public License v3.0 6 votes vote down vote up
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 
Example #3
Source File: collections.py    From planespotter with MIT License 6 votes vote down vote up
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 
Example #4
Source File: collections.py    From pyRevit with GNU General Public License v3.0 6 votes vote down vote up
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 
Example #5
Source File: collections.py    From stdm with GNU General Public License v2.0 6 votes vote down vote up
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 
Example #6
Source File: collections.py    From sqlalchemy with MIT License 6 votes vote down vote up
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 
Example #7
Source File: collections.py    From jarvis with GNU General Public License v2.0 6 votes vote down vote up
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 
Example #8
Source File: collections.py    From moviegrabber with GNU General Public License v3.0 6 votes vote down vote up
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 
Example #9
Source File: collections.py    From android_universal with MIT License 6 votes vote down vote up
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