This repository was archived by the owner on Aug 21, 2023. It is now read-only.
feat: instatiate db using sqlalch#238
Open
internnos wants to merge 30 commits intoonlydust-com:mainfrom
Open
Conversation
ExoMonk
reviewed
Sep 15, 2022
| github = Column(String(255), nullable=False) | ||
| username = Column(String(255), nullable=False) | ||
| score = Column(Integer, nullable=False, default=0) | ||
| starklings_user = relationship("ValidatedExercise") |
Collaborator
There was a problem hiding this comment.
rename it to validated_exercises
Author
There was a problem hiding this comment.
according to the docs, the arg to relationship is the Class name cmiiw
Author
There was a problem hiding this comment.
if i change to table name, i'll get this error instead
sqlalchemy.exc.ArgumentError: relationship 'starklings_user' expects a class or a mapper argument (received: <class 'sqlalchemy.sql.schema.Table'>)
ExoMonk
reviewed
Sep 16, 2022
| github = request.json.get('github', None) | ||
| message_hash = request.json.get('message_hash', '') | ||
| network = request.json.get('network', 'testnet') | ||
| if None in [wallet_address, signature, github]: |
Collaborator
There was a problem hiding this comment.
github is not mandatory yet
ExoMonk
reviewed
Sep 18, 2022
|
|
||
| except IntegrityError as e: | ||
| db.session.rollback() | ||
| session.rollback() |
ExoMonk
reviewed
Sep 18, 2022
| db.session.commit() | ||
| return f'Welcome! {username}', 200 | ||
| # verify signature | ||
| verify_signature = VerifySignature(abi, network, wallet_address) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #232 #227 #231
changed
StarklingsuserintoStarklingsUserinmodels.pyadded
db.py, script to instantiate db w.r.t tomodels.pyusing sqlalchstarklings-backend/starklings_backend/utils.py