gwy15
2019-11-10 14:27:47 +08:00
复制粘贴:
1st -> 1:33
-> when you should commit() your database session
2nd -> 7:20
-> three attributes of the session you probably don't know about (new, deleted, dirty) sounds great for all tracking of changes to objects
3rd -> 11:08
-> related to 2nd regarding when these 3 lists are cleaned and when the db session is cleared in Flask SQLAlchemy; remove() method of the session; how does it affect long-running tasks (e.g celery); be aware of memory usage
4th -> 14:09 -> nice way for handling db.session.remove() and keeping clean the session via context manager.