Blog Python Model code and SQLite Database.
From VSCode using SQLite3 Editor, show your unique collection/table in database, display rows and columns in the table of the SQLite database.
This image shows the sqlite database containing the name of the button, the userID, and the button’s likes & dislikes
From VSCode model, show your unique code that was created to initialize table and create test data.
This code is used to create the name formatting name, type, content, userID, likes, dislikes, description with the class Design(db.Model):
Blog Python API code and use of List and Dictionaries.
In VSCode using Debugger, show a list as extracted from database as Python objects.
This screenshot is taken in debugger after running the search function. We see multiple Design objects which have been freshly loaded from our database.
In VSCode use Debugger and list, show two distinct example examples of dictionaries, show Keys/Values using debugger.
The screenshot is taken in debugger and shows the request body json when saving a design.
Blog Python API code and use of Postman to request and respond with JSON.
In VSCode, show Python API code definition for request and response using GET, POST, UPDATE methods. Discuss algorithmic condition used to direct request to appropriate Python method based on request method.
The screenshot is taken from the users api file and shows the definition of CRUD operations that are run after POST, GET, or PUT requests.
In VSCode, show algorithmic conditions used to validate data on a POST condition.
The code in the screenshot above checks to see whether certain variables in the request body json are valid or not. If they are, then they will be updated into the user’s entry in the collection in the database.
Blog JavaScript API fetch code and formatting code to display JSON.
In JavaScript code, show and describe code that handles failure. Describe how the code shows failure to the user in the Chrome Browser screen.
The screenshot shows the browser showing an unsuccessful result by alerting the user to ‘please enter a design name’.