Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Lecture TWP42: Bases de datos (indexedDB approach) #171

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AngelaRemolina
Copy link
Collaborator

@AngelaRemolina AngelaRemolina commented Aug 9, 2021

Summary

This PR may close: AngelaRemolina#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

  • Variables, functions and comments are translated to Spanish
  • Functions follow underscore notation
  • Spell check done & typos fixed
  • All python code is PEP8 compliant
  • Test coverage with Playwright implemented; locators are Pyhton code
  • Reviewers assigned (all peers & at least 1 mentor)

Screenshots

indexedDB

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

1 similar comment
@github-actions
Copy link

github-actions bot commented Aug 9, 2021

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review Bases de datos lecture
1 participant