Generic form system: grant admin display + export (PR 4/5) - #4710
Generic form system: grant admin display + export (PR 4/5)#4710marcoacierno wants to merge 6 commits into
Conversation
display_answer_value renders a stored value per question type (option labels, Yes/No booleans); display_answers pairs a FormAnswer's values with question labels in question order, appending orphaned question ids. Shared by the grant admin display and export columns.
The grant change page renders the linked FormAnswer as a read-only question/answer list in "The Grant" fieldset (empty state for legacy grants). The CSV export grows one column per question of the conference's grant form: fields are added in before_export (which runs before headers are built, and already resolves the conference) and values come from export_field, since dehydrate_method only supports method names, not per-question callables. Legacy soft-question columns stay; historical grants export empty cells.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Function-local imports moved to module top and aligned with the file's existing conventions (AdminSite instance, GrantResource in the shared import block).
|
Adds display helpers for stored generic-form answers and wires them into the grant admin change page (read-only Q&A block) and CSV export (one column per grant-form question via Import order in |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## generic-forms/03-grants-backend #4710 +/- ##
===================================================================
+ Coverage 92.49% 92.51% +0.01%
===================================================================
Files 359 359
Lines 10970 10995 +25
Branches 863 871 +8
===================================================================
+ Hits 10147 10172 +25
Misses 706 706
Partials 117 117 🚀 New features to boost your workflow:
|
Summary
Fourth PR of the stack (stacked on #4709 ← #4707 ← #4705). Organizers see and export dynamic answers.
Question <id>), question-ordered. Empty state for legacy grants.GrantResource.before_export(runs before headers are built and already resolves the conference — same spot as the existing submissions prefetch); values via anexport_fieldoverride (dehydrate_methodonly takes method names, so per-question closures aren't possible). Historical grants export empty cells; the legacy soft-question columns stay untouched. Export queryset gainsselect_related("form_answer").display_answer_value/display_answershelpers live ingeneric_forms/services.py.Test plan
Stack: #4705 → #4707 → #4709 → PR4 (this) → PR5 frontend.