File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,34 @@ $ python manage.py runserver
4040
4141More information? Follow explanatory videos below.
4242
43+ ## How to execute queries manually?
44+
45+ Inside on your virtualenv:
46+ ```
47+ $ python manage.py shell
48+ ```
49+
50+ Import db and model:
51+ ```
52+ from tvseries.ext import db
53+ from tvseries.core.models import TVSerie
54+ ```
55+
56+ Bind your session with your application:
57+ ```
58+ db.app = app
59+ ```
60+
61+ Quering example:
62+ ```
63+ db.session.query(TVSerie).all()
64+ ```
65+
66+ If operation is "create", "update" or "delete" dont forget to run commit operation to confirm operation:
67+ ```
68+ db.session.commit()
69+ ```
70+
4371## 1.0 - Flask and the most basic application of the world!
4472
4573- See release code: https://github.com/rafaelhenrique/flask_tutorial/tree/1.0
You can’t perform that action at this time.
0 commit comments