Skip to content

Fix #322: Add comprehensive plan details to resource map report#826

Open
AKSHARVAGHASIYA wants to merge 1 commit intocore-stack-org:mainfrom
AKSHARVAGHASIYA:fix/issue-322
Open

Fix #322: Add comprehensive plan details to resource map report#826
AKSHARVAGHASIYA wants to merge 1 commit intocore-stack-org:mainfrom
AKSHARVAGHASIYA:fix/issue-322

Conversation

@AKSHARVAGHASIYA
Copy link
Copy Markdown

Resolves: #322

Overview

This PR resolves Issue #322 by injecting comprehensive geographical and administrative metadata into the resource map report generator, satisfying the requirement to display detailed context regarding "what plan was used to create this".

Changes Made

Backend (dpr/api.py):

Modified generate_resource_report to query the PostgreSQL database for the PlanApp model using the incoming plan_id request parameter.

Securely passed the parsed entity (Village, Organization, Project, and Facilitator mappings) down to the django rendering context via a new plan_details dictionary.

Frontend (templates/resource-report.html):

Expanded the CSS flexbox header to conditionally render the new descriptive fields if plan_details is attached to the render context, significantly improving the report's detail.

Testing Performed

Started the local django development server.

Navigated to http://127.0.0.1:8000/api/v1/generate_resource_report/?plan_id= and verified the server dynamically fetches the DB relational plan data without crashing, and gracefully catches DoesNotExist exceptions for invalid IDs. Ensure the layout strictly adheres to print-rendering standards.

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.

Add details about the plan in the resource map coming along with DPR

1 participant