Flask-sqlalchemy Signal Support

Source: Internet
Author: User

Starting with Flask-sqlalchemy 0.10, you can connect to a signal to get a notification of what's going on.

The following two signals exist:

models_committed

This signal is emitted when the modified model is submitted to the database. The sender is the app that sent the modifications. The model and Operation description utilises (model,operation) forms as tuples, such that the tuple list is passed to the recipient's change parameter.

The model is a model instance that is sent to the database, and when a model is inserted, the operation is ' insert ' and the deletion is ' delete '. If any of the columns are updated, it will be ' update '.

before_models_committed

Except that it happens just before the commit is sent, exactly the same as models_committed.

Flask-sqlalchemy Signal Support

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.