def delete(self, synchronize_session='evaluate'):
    'Perform a bulk delete query.\n\n        Deletes rows matched by this query from the database.\n\n        :param synchronize_session: chooses the strategy for the removal of\n            matched objects from the session. Valid values are:\n\n            ``False`` - don\'t synchronize the session. This option is the most\n            efficient and is reliable once the session is expired, which\n            typically occurs after a commit(), or explicitly using\n            expire_all(). Before the expiration, objects may still remain in\n            the session which were in fact deleted which can lead to confusing\n            results if they are accessed via get() or already loaded\n            collections.\n\n            ``\'fetch\'`` - performs a select query before the delete to find\n            objects that are matched by the delete query and need to be\n            removed from the session. Matched objects are removed from the\n            session.\n\n            ``\'evaluate\'`` - Evaluate the query\'s criteria in Python straight\n            on the objects in the session. If evaluation of the criteria isn\'t\n            implemented, an error is raised.  In that case you probably\n            want to use the \'fetch\' strategy as a fallback.\n\n            The expression evaluator currently doesn\'t account for differing\n            string collations between the database and Python.\n\n        :return: the count of rows matched as returned by the database\'s\n          "row count" feature.\n\n        This method has several key caveats:\n\n        * The method does **not** offer in-Python cascading of relationships\n          - it is assumed that ON DELETE CASCADE/SET NULL/etc. is configured\n          for any foreign key references which require it, otherwise the\n          database may emit an integrity violation if foreign key references\n          are being enforced.\n\n          After the DELETE, dependent objects in the :class:`.Session` which\n          were impacted by an ON DELETE may not contain the current\n          state, or may have been deleted. This issue is resolved once the\n          :class:`.Session` is expired,\n          which normally occurs upon :meth:`.Session.commit` or can be forced\n          by using :meth:`.Session.expire_all`.  Accessing an expired object\n          whose row has been deleted will invoke a SELECT to locate the\n          row; when the row is not found, an\n          :class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.\n\n        * The :meth:`.MapperEvents.before_delete` and\n          :meth:`.MapperEvents.after_delete`\n          events are **not** invoked from this method.  Instead, the\n          :meth:`.SessionEvents.after_bulk_delete` method is provided to act\n          upon a mass DELETE of entity rows.\n\n        .. seealso::\n\n            :meth:`.Query.update`\n\n            :ref:`inserts_and_updates` - Core SQL tutorial\n\n        '
    delete_op = persistence.BulkDelete.factory(self, synchronize_session)
    delete_op.exec_()
    return delete_op.rowcount
Perform a bulk delete query.

Deletes rows matched by this query from the database.

:param synchronize_session: chooses the strategy for the removal of
    matched objects from the session. Valid values are:

    ``False`` - don't synchronize the session. This option is the most
    efficient and is reliable once the session is expired, which
    typically occurs after a commit(), or explicitly using
    expire_all(). Before the expiration, objects may still remain in
    the session which were in fact deleted which can lead to confusing
    results if they are accessed via get() or already loaded
    collections.

    ``'fetch'`` - performs a select query before the delete to find
    objects that are matched by the delete query and need to be
    removed from the session. Matched objects are removed from the
    session.

    ``'evaluate'`` - Evaluate the query's criteria in Python straight
    on the objects in the session. If evaluation of the criteria isn't
    implemented, an error is raised.  In that case you probably
    want to use the 'fetch' strategy as a fallback.

    The expression evaluator currently doesn't account for differing
    string collations between the database and Python.

:return: the count of rows matched as returned by the database's
  "row count" feature.

This method has several key caveats:

* The method does **not** offer in-Python cascading of relationships
  - it is assumed that ON DELETE CASCADE/SET NULL/etc. is configured
  for any foreign key references which require it, otherwise the
  database may emit an integrity violation if foreign key references
  are being enforced.

  After the DELETE, dependent objects in the :class:`.Session` which
  were impacted by an ON DELETE may not contain the current
  state, or may have been deleted. This issue is resolved once the
  :class:`.Session` is expired,
  which normally occurs upon :meth:`.Session.commit` or can be forced
  by using :meth:`.Session.expire_all`.  Accessing an expired object
  whose row has been deleted will invoke a SELECT to locate the
  row; when the row is not found, an
  :class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.

* The :meth:`.MapperEvents.before_delete` and
  :meth:`.MapperEvents.after_delete`
  events are **not** invoked from this method.  Instead, the
  :meth:`.SessionEvents.after_bulk_delete` method is provided to act
  upon a mass DELETE of entity rows.

.. seealso::

    :meth:`.Query.update`

    :ref:`inserts_and_updates` - Core SQL tutorial
def delete(self, synchronize_session='evaluate'):
    'Perform a bulk delete query.\n\n        Deletes rows matched by this query from the database.\n\n        :param synchronize_session: chooses the strategy for the removal of\n            matched objects from the session. Valid values are:\n\n            ``False`` - don\'t synchronize the session. This option is the most\n            efficient and is reliable once the session is expired, which\n            typically occurs after a commit(), or explicitly using\n            expire_all(). Before the expiration, objects may still remain in\n            the session which were in fact deleted which can lead to confusing\n            results if they are accessed via get() or already loaded\n            collections.\n\n            ``\'fetch\'`` - performs a select query before the delete to find\n            objects that are matched by the delete query and need to be\n            removed from the session. Matched objects are removed from the\n            session.\n\n            ``\'evaluate\'`` - Evaluate the query\'s criteria in Python straight\n            on the objects in the session. If evaluation of the criteria isn\'t\n            implemented, an error is raised.  In that case you probably\n            want to use the \'fetch\' strategy as a fallback.\n\n            The expression evaluator currently doesn\'t account for differing\n            string collations between the database and Python.\n\n        :return: the count of rows matched as returned by the database\'s\n          "row count" feature.\n\n        This method has several key caveats:\n\n        * The method does **not** offer in-Python cascading of relationships\n          - it is assumed that ON DELETE CASCADE/SET NULL/etc. is configured\n          for any foreign key references which require it, otherwise the\n          database may emit an integrity violation if foreign key references\n          are being enforced.\n\n          After the DELETE, dependent objects in the :class:`.Session` which\n          were impacted by an ON DELETE may not contain the current\n          state, or may have been deleted. This issue is resolved once the\n          :class:`.Session` is expired,\n          which normally occurs upon :meth:`.Session.commit` or can be forced\n          by using :meth:`.Session.expire_all`.  Accessing an expired object\n          whose row has been deleted will invoke a SELECT to locate the\n          row; when the row is not found, an\n          :class:`~sqlalchemy.orm.exc.ObjectDeletedError` is raised.\n\n        * The :meth:`.MapperEvents.before_delete` and\n          :meth:`.MapperEvents.after_delete`\n          events are **not** invoked from this method.  Instead, the\n          :meth:`.SessionEvents.after_bulk_delete` method is provided to act\n          upon a mass DELETE of entity rows.\n\n        .. seealso::\n\n            :meth:`.Query.update`\n\n            :ref:`inserts_and_updates` - Core SQL tutorial\n\n        '
    delete_op = persistence.BulkDelete.factory(self, synchronize_session)
    delete_op.exec_()
    return delete_op.rowcount