Refactor Lecture TWP42: Bases de datos (indexedDB approach)
Summary
This PR may close: https://github.com/angelasofiaremolinagutierrez/PyZombis/issues/48
I have implemented an approach to solve this issue of lecture TWP 42: Bases de datos with an API that is supported by Brython called indexedDB.
Important note: The refactoring is not finished, this is just a test. Even though this is a functional solution, the syntax changes a lot from the original lecture where sqlite3 was used.
For example:
cursor.execute("select * from surfers where age > 25")
linhas = cursor.fetchall()
for linha in linhas:
print("id :",linha['id'])
print("Nombre :",linha['name'])
print("Pais :",linha['country'])
print("Media :",linha['average'])
print("Estilo :",linha['board'])
print("Edad :",linha['age'])
print()
had to change to:
if(getattr(v, "edad") >=25):
for key in ["nombre", "pais", "media", "estilo", "edad"]:
print(f"{key}: {getattr(v, key)}")
getattr(res, "continue")()
I will keep exploring other possible options, but this is a starting point in case none other option is found.
Checklist
- [x] Variables, functions and comments are translated to Spanish
- [x] Functions follow underscore notation
- [x] Spell check done & typos fixed
- [x] All python code is PEP8 compliant
- [x] Test coverage with Playwright implemented; locators are Pyhton code
- [x] Reviewers assigned (all peers & at least 1 mentor)
Screenshots

Published to http://pyar.github.io/PyZombis/171/index.html
Published to http://pyar.github.io/PyZombis/171/index.html
Published to http://pyar.github.io/PyZombis/171/index.html