Skip to content

Commit

Permalink
Add where condition for districtr map uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
nofurtherinformation committed Oct 3, 2024
1 parent 145e78e commit b09e265
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@ async def get_assignments(document_id: str, session: Session = Depends(get_sessi
Assignments.document_id,
ParentChildEdges.parent_path,
)
.join(
ParentChildEdges,
Assignments.geo_id == ParentChildEdges.child_path,
isouter=True,
.outerjoin(ParentChildEdges, Assignments.geo_id == ParentChildEdges.child_path)
.join(DistrictrMap, ParentChildEdges.districtr_map == DistrictrMap.uuid)
.join(Document, Assignments.document_id == Document.document_id)
.where(
Assignments.document_id == document_id,
DistrictrMap.gerrydb_table_name == Document.gerrydb_table
)
.where(Assignments.document_id == document_id)
)

results = session.exec(stmt)
Expand Down

0 comments on commit b09e265

Please sign in to comment.