- Use of subqueries into a main query in SQLAlchemy.
- Using .paginate() vs .all() methods in SQLAlchemy. They don't work together.
- .all() method runs the query and returns all results as a list of objects.
- .paginate() Flask-SQLAlchemy method used to devide a big amount of data in smaller pages. Should be applied directly to the query before converting to JSON format.
- .strftime() python method used to format datetime objects into a text string according to a specified format. This is useful because JSON does not have a native datetime data type and needs to work with text strings to represent dates and times.
- .gitignore file updated to ignore unnecessary cached files and folders using the
git rm -r --cached .
command in the terminal (windows bash).
controllers
folder for the 3 endpoints (taxis, trajectories/id and trajectories/latest)
- import routes in the
app.py
file (fromcontrollers
folder)
N/A
N/A
- SQLite connection for testing purposes
- Use of SQLAlchemy to create tables and insert data in SQLite
- Run in the terminal
ENVIRONMENT=development Flask run
to run the developmemt environment - Run in the terminal
ENVIRONMENT=testing pytest -vs
to run the developmemt environment
- ENVIRONMENT=development variable in .env file and run it in the terminal
N/A
N/A
vercel_connection.py
file which was using psycopg2 library
- Understanding blueprint architecture
- Modularization with blueprint
- Create a parameter as part of the URL path in
/trajectories/taxi_id
- Create multiple queries at once with SQLAlchemy
- Use of timedelta an object that represents a duration, the difference between two instants of time.
- Correctly run coverage reports with pytest
- Understanding environment configurations
- Use of request_context() for e2e testing
- Created
taxi_route.py
andtrajectory_route.py
files into models folder - create_app() function in
app.py
file and all running the program related code only put into this function
taxi_model.py
file tomodels.py
for both taxis and trajectories models
N/A
- /taxis endpoint from
app.py
file to modularize and limit responsabilities
- Understanding MVC arquitecture
- Testing with pytest and fixtures
- Unit testing
- Understanding e2e testing and its difference with unit and integration testing
- The use of conftest file to make fitures global and avoid repeating lines of code.
- Created an independent test folder (outside the main folder
src
) - Created the
conftest.py
file - Created the
test_app.py
file for unit testing - Created the
test_e2e.py
file for e2e testing
N/A
N/A
N/A
- Creation of swagger documentation (not fully)
- Modularizing the project (still learning).
- Creation of endpoints and its pagination.
- paginate() is a non iterable object so I learnt the use of .item which iterates it as a list.
- Use of postman to check how to paginate the endpoint and apply it to the code using SQLAlchemy.
- Created folder models to store taxi model at first place.
- Created the config.py file to set up SQLAlchemy module and interact with postgre db and separate responsibilities in the app.py file.
- Created templates folder and added an index.html file (for practicing).
- Created the endpoint /taxis in the app.py file with its pagination using SQLAlchemy.
- Changed the conexion.py file to vercel_connect.py (this file is not in use)
N/A
- Removed templates folder I added for practicing routes creations
- Vercel postgresSQL
- Database connection (from vercel postgre to PGAdmin and to VSCode) using psycopg2 module to access postgreSQL
- Environment variables and accessing to those variables using os module with os.getenv(""), os.environ.get("") and os.environ[""]
- SQL commands in PostgreSQL (tables creation, visualization, data insertion from vercel and PGAdmin)
- Running flask app with a simple routing using http://127.0.0.1:5000 (for practicing)
- Created database in vercel
- Created the SRC folder
- Created a conexion.py file
- Stablished connection to vercel database in the conexion.py file
- Created taxis and trajectories tables
- Inserted the data provided by Laboratoria into each table
- Created the app.py file to run flask (for practicing)
- Created templates folder and added an index.html file (for practicing)
N/A
N/A
N/A