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

Election and some other stuff #104

Merged
merged 16 commits into from
Jan 19, 2025
Merged

Election and some other stuff #104

merged 16 commits into from
Jan 19, 2025

Conversation

Equasa
Copy link
Contributor

@Equasa Equasa commented Jan 3, 2025

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.

@Equasa Equasa requested review from Trobbi and PelicanQ January 3, 2025 13:46
db_models/election_model.py Outdated Show resolved Hide resolved
routes/candidate_router.py Outdated Show resolved Hide resolved
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()

Copy link
Contributor

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.

routes/election_router.py Outdated Show resolved Hide resolved
routes/election_router.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Trobbi Trobbi left a 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.

@Equasa Equasa requested a review from Trobbi January 19, 2025 10:04
@@ -50,6 +46,4 @@

main_router.include_router(car_router, prefix="/car", tags=["cars"])

main_router.include_router(election_router, prefix="/election", tags=["elections"])
Copy link
Contributor

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 :(

Copy link
Contributor

@Trobbi Trobbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Equasa Equasa merged commit 3e37833 into main Jan 19, 2025
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