-
Notifications
You must be signed in to change notification settings - Fork 1
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
Election and some other stuff #104
Conversation
…dd some more things to tables
…different route stuff
def get_all_candidations(election_id: int, db: DB_dependency): | ||
# .join(User_DB) | ||
candidations = db.query(Candidate_DB).join(User_DB).filter(Candidate_DB.election_id == election_id).all() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kanske lägga en kommentar att candidations listan kommer bli även om electionen du är ute efter inte existerar istället för att det ger ett error. Detta kommer typ dock aldrig hända i verkligheten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Riktigt snyggt gjort! Galet hur allt kopplas ihop! La några kommenterarer efter jag läst igenom några gånger, men har möjligtvis missat något pga den komplicerade strukturen som fås.
Vi kommer också behöva skapa funktionaliteten för att nominera, men detta kan göras senare. Borde bara vara att modifiera create_candidation.
Sedan skulle vi också behöva patch routes för de flesta grejerna men detta kan också göras i en senare PR.
routes/__init__.py
Outdated
@@ -50,6 +46,4 @@ | |||
|
|||
main_router.include_router(car_router, prefix="/car", tags=["cars"]) | |||
|
|||
main_router.include_router(election_router, prefix="/election", tags=["elections"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Detta verkar ha försvunnit i mergen :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull-request has working routes, models etc. The whole election system isn't completely done in this PR but I wan't to save the kind soul looking at this PR from getting depressed. Will do another PR when this is done.