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

Migrate db to sqlalchemy #83

Merged
merged 20 commits into from
Jan 2, 2025
Merged

Migrate db to sqlalchemy #83

merged 20 commits into from
Jan 2, 2025

Conversation

EduKav1813
Copy link
Collaborator

@EduKav1813 EduKav1813 commented Nov 5, 2024

The goal of this PR is to migrate from <Flask + peewee> to <Flask + SQLAlchemy> stack. The migration is also followed by a partial refactoring on the MVP patter (sort of), but without a presenter right now.

While I tested the setup manually, I would like to write more tests to simplify validation. Right now the PR is in the Draft phase.

Another thing is that I implemented a BitField type, and after testing I realized that it may be a misuse/overkill. It supports multiple flags, where each bit is a flag. In the current version of the application we need it to store the anonymity, which might be better implemented via Enum or something. I am not sure if we would need this BitField in the future. Please let me know in the comments.

P.S: I will also check for missing type hints and docstrings (I have to write many) later.

Changes:
- Removing pyparsing (3.0.7)
- Updating packaging (21.3 -> 24.1)
- Updating gunicorn (21.2.0 -> 23.0.0)
- Updating psycopg2-binary (2.9.9 -> 2.9.10)
- Updating pysqlite3 (0.5.3 -> 0.5.4)
- Updating pytz (2024.1 -> 2024.2)

Signed-off-by: Eduard Kaverinskyi <[email protected]>
Signed-off-by: Eduard Kaverinskyi <[email protected]>
Signed-off-by: Eduard Kaverinskyi <[email protected]>
@EduKav1813 EduKav1813 self-assigned this Nov 5, 2024
whois/web.py Outdated Show resolved Hide resolved
whois/web.py Outdated Show resolved Hide resolved
whois/settings_test.py Outdated Show resolved Hide resolved
@EduKav1813 EduKav1813 marked this pull request as ready for review November 12, 2024 20:34
@EduKav1813 EduKav1813 requested a review from not7cd November 12, 2024 20:34
@EduKav1813
Copy link
Collaborator Author

@not7cd I implemented everything I wanted in this PR, and I think it is ready for review. To not grow this PR any further I would focus on testing and merging this, and to implement/move any other functionality in separate PR's/issues

@EduKav1813
Copy link
Collaborator Author

@not7cd Additionally, since you are much more experienced with Mikrotik, I would like to ask you to review the structure of the settings templates: whois/settings/settings_template.py. I suspect that there may be some settings in one class that may belong to the other, and while it does not makes significant practical difference, organizing them properly would help people with less domain knowledge on this matter.

@EduKav1813 EduKav1813 requested a review from oneacik November 30, 2024 17:54
@EduKav1813
Copy link
Collaborator Author

@oneacik As we agreed, added you as a reviewer

@not7cd not7cd merged commit cdc23a6 into master Jan 2, 2025
1 check passed
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.

2 participants