Skip to content

Ginni/feature/6 project site endpoints - #18

Merged
FakeDeepLearner merged 10 commits into
mainfrom
ginni/feature/6_project_site_endpoints
Nov 4, 2026
Merged

FakeDeepLearner merged 10 commits into
mainfrom
ginni/feature/6_project_site_endpoints

Conversation

@Ginni-2007

@Ginni-2007 Ginni-2007 commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

What this changes

Closes #6
Adds the two read endpoints the app uses before a worker records anything

  • GET /api/projects/: lists active projects
  • GET /api/projects/<id>/sites/: lists a project's sites, each with its region nested; uses select_related("region") so it's one query regardless of how many sites
  • seed_projects management command: 5 Honduran regions (department capitals, coordinates from Wikipedia), 1 active and 1 closed project, 5 farms. Uses get_or_create, so it's safe to run more than once
  • Tests in backend/tests/test_projects.py

How to test it

  1. Seed the data (run it twice to confirm no duplicates)
  2. Tests in backend/tests/test_projects
  3. Probably should run migrations

Checklist

  • Backend tests pass (cd backend && python -m pytest)
  • I ran the app and the screen I touched still works
  • If I changed a model, the migration is committed
  • No .env, credentials, or LAN IP in the diff
  • Review requested from my pair

Notes for the reviewer

@Ginni-2007 Ginni-2007 added this to the Sprint 1 milestone Oct 25, 2026
@Ginni-2007
Ginni-2007 marked this pull request as draft October 25, 2026 21:19
@Ginni-2007
Ginni-2007 marked this pull request as ready for review October 29, 2026 00:42

@FakeDeepLearner FakeDeepLearner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please take a look at the feedback I left in #20, specifically the section about fixtures, as it also applies to you

FakeDeepLearner
FakeDeepLearner previously approved these changes Nov 2, 2026

@FakeDeepLearner FakeDeepLearner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great now, thanks!

@Ginni-2007
Ginni-2007 dismissed FakeDeepLearner’s stale review November 2, 2026 03:55

The merge-base changed after approval.

@FakeDeepLearner
FakeDeepLearner self-requested a review November 3, 2026 00:32
FakeDeepLearner
FakeDeepLearner previously approved these changes Nov 3, 2026

@FakeDeepLearner FakeDeepLearner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks great, thanks!

@Ginni-2007
Ginni-2007 dismissed FakeDeepLearner’s stale review November 3, 2026 00:33

The merge-base changed after approval.

FakeDeepLearner
FakeDeepLearner previously approved these changes Nov 3, 2026

@FakeDeepLearner FakeDeepLearner left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

@Ginni-2007
Ginni-2007 dismissed FakeDeepLearner’s stale review November 3, 2026 02:23

The merge-base changed after approval.

@FakeDeepLearner
FakeDeepLearner merged commit c198ab3 into main Nov 4, 2026
0 of 2 checks passed
@FakeDeepLearner
FakeDeepLearner deleted the ginni/feature/6_project_site_endpoints branch November 4, 2026 01:06
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.

Seed data and the project and site list endpoints

3 participants