nighthawkcoders / teacher_portfolio

GitHub Pages / Jupyter Notebook guides for Python, Java, JavaScript, Linux
https://nighthawkcoders.github.io/teacher_portfolio/
Apache License 2.0
1 stars 51 forks source link

Python/Flask User Database introduction #49

Open jm1021 opened 9 months ago

jm1021 commented 9 months ago

Owners

P1. Kyle Liang, Akhil Singamneni, Aashray Rajagopalan, Shuban Pal P2. David, Matthew, Kayden, Andrew, Ameer P4. Arthur, Eun, Nikki, Patrick P5. Pranavi, Tanvi, Shubhay, Tanay

Python Flask User Table (database)

Student will provide lessons and Python code that contains the foundations for a User table within an SQL database. Students will develop anatomy of a Python SQLAlchemy OOP User table within an SQL database. Discussion on SQL and use sqlite3 to view table would be valuable for verification and debugging.

Focus. The lesson should focus on the CRUD operations between API and Model layers in backend. Not a focus. OOP should NOT be a focus as it is covered in future lessons.

jm1021 commented 9 months ago

Objective of this lesson is to go over SQL database as it is implemented in flask_portfolio. Key emphasis is on User table and how to enhance User table. For an enhancement it is suggest to add a JSONB data type to the table for a hack. This data type is used to store JSON data. JSON could keep any type of List that you want to associate with a user (fiends/contacts, favorite jokes, daily workouts)

OOP Database

jm1021 commented 9 months ago

Note, as people look for Python databases on the web they will often run into imperative style implementation versus OOP style. This is provided for reference, but it is not recommended as the primary implementation for this class.

Imperative Sytle