Skip to content

Commit c3fa714

Browse files
committed
SQLAlchemy ORM updates
1 parent 62f70be commit c3fa714

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Module 1 - Python Programming/9. Databases/.ipynb_checkpoints/SQLAlchemy ORM-checkpoint.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
"source": [
1616
"### Setup\n",
1717
"\n",
18-
"1. Install the modules \n",
18+
"**Step-1:** Install the modules \n",
1919
"- `pip install Flask-SQLAlchemy` \n",
2020
"- `pip install Flask-Migrate`\n",
2121
"\n",
22-
"2. Create a Flask App\n",
22+
"**Step-2:** Create a Flask App\n",
2323
"```\n",
2424
"from flask import Flask\n",
2525
"app = Flask(__name__)\n",
2626
"```\n",
2727
"\n",
28-
"3. Import SQLAlchemy and Migrate module\n",
28+
"**Step-3:** Import SQLAlchemy and Migrate module\n",
2929
"```\n",
3030
"from flask_sqlalchemy import SQLAlchemy\n",
3131
"from flask_migrate import Migrate\n",
3232
"```\n",
3333
"\n",
34-
"4. SQLAlchemy Configuration and pass the application into SQLAlchemy class\n",
34+
"**Step-4:** SQLAlchemy Configuration and pass the application into SQLAlchemy class\n",
3535
"\n",
3636
"```\n",
3737
"basedir = os.path.abspath(os.path.dirname(__file__))\n",
@@ -43,7 +43,7 @@
4343
"Migrate(app, db)\n",
4444
"```\n",
4545
"\n",
46-
"5. Create a Model or Table\n",
46+
"**Step-5:** Create a Model or Table\n",
4747
"- Create a Model Class\n",
4848
"- Inherit from `db.Model`\n",
4949
"- Provide the table name\n",
@@ -62,7 +62,7 @@
6262
" return \"Sabji Name - {} and MRP - {}\".format(self.name, self.mrp)\n",
6363
"```\n",
6464
"\n",
65-
"6. Run the following commands to Migrate the Database \n",
65+
"**Step-6:** Run the following commands to Migrate the Database \n",
6666
"- `set FLASK_APP=app.py` \n",
6767
"- `flask db init` \n",
6868
"- `flask db migrate -m \"My first DB migrate\"` \n",

Module 1 - Python Programming/9. Databases/SQLAlchemy ORM.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
"source": [
1616
"### Setup\n",
1717
"\n",
18-
"1. Install the modules \n",
18+
"**Step-1:** Install the modules \n",
1919
"- `pip install Flask-SQLAlchemy` \n",
2020
"- `pip install Flask-Migrate`\n",
2121
"\n",
22-
"2. Create a Flask App\n",
22+
"**Step-2:** Create a Flask App\n",
2323
"```\n",
2424
"from flask import Flask\n",
2525
"app = Flask(__name__)\n",
2626
"```\n",
2727
"\n",
28-
"3. Import SQLAlchemy and Migrate module\n",
28+
"**Step-3:** Import SQLAlchemy and Migrate module\n",
2929
"```\n",
3030
"from flask_sqlalchemy import SQLAlchemy\n",
3131
"from flask_migrate import Migrate\n",
3232
"```\n",
3333
"\n",
34-
"4. SQLAlchemy Configuration and pass the application into SQLAlchemy class\n",
34+
"**Step-4:** SQLAlchemy Configuration and pass the application into SQLAlchemy class\n",
3535
"\n",
3636
"```\n",
3737
"basedir = os.path.abspath(os.path.dirname(__file__))\n",
@@ -43,7 +43,7 @@
4343
"Migrate(app, db)\n",
4444
"```\n",
4545
"\n",
46-
"5. Create a Model or Table\n",
46+
"**Step-5:** Create a Model or Table\n",
4747
"- Create a Model Class\n",
4848
"- Inherit from `db.Model`\n",
4949
"- Provide the table name\n",
@@ -62,7 +62,7 @@
6262
" return \"Sabji Name - {} and MRP - {}\".format(self.name, self.mrp)\n",
6363
"```\n",
6464
"\n",
65-
"6. Run the following commands to Migrate the Database \n",
65+
"**Step-6:** Run the following commands to Migrate the Database \n",
6666
"- `set FLASK_APP=app.py` \n",
6767
"- `flask db init` \n",
6868
"- `flask db migrate -m \"My first DB migrate\"` \n",

0 commit comments

Comments
 (0)