Skip to content

Commit 36903d6

Browse files
committed
feat(full-eap): add additional attachments for full eap
1 parent 0c86b71 commit 36903d6

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

assets

eap/admin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
@admin.register(EAPFile)
1515
class EAPFileAdmin(admin.ModelAdmin):
1616
search_fields = ("caption",)
17+
list_select_related = True
18+
autocomplete_fields = (
19+
"created_by",
20+
"modified_by",
21+
)
1722

1823

1924
@admin.register(EAPRegistration)

eap/serializers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ class MiniFullEAPSerializer(
215215
):
216216
updated_checklist_file_details = EAPFileSerializer(source="updated_checklist_file", read_only=True)
217217
budget_file_details = EAPFileSerializer(source="budget_file", read_only=True)
218+
theory_of_change_table_file_details = EAPFileSerializer(source="theory_of_change_table_file", read_only=True)
219+
forecast_table_file_details = EAPFileSerializer(source="forecast_table_file", read_only=True)
218220

219221
class Meta:
220222
model = FullEAP
@@ -230,6 +232,8 @@ class Meta:
230232
"is_locked",
231233
"review_checklist_file",
232234
"updated_checklist_file_details",
235+
"theory_of_change_table_file_details",
236+
"forecast_table_file_details",
233237
"created_at",
234238
"modified_at",
235239
)

eap/views.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def get_queryset(self) -> QuerySet[EAPRegistration]:
108108
)
109109
.prefetch_related(
110110
"partners",
111+
"users",
111112
Prefetch(
112113
"simplified_eaps",
113114
queryset=SimplifiedEAP.objects.select_related(
@@ -122,6 +123,12 @@ def get_queryset(self) -> QuerySet[EAPRegistration]:
122123
queryset=FullEAP.objects.select_related(
123124
"budget_file__created_by",
124125
"budget_file__modified_by",
126+
"updated_checklist_file__created_by",
127+
"updated_checklist_file__modified_by",
128+
"theory_of_change_table_file__created_by",
129+
"theory_of_change_table_file__modified_by",
130+
"forecast_table_file__created_by",
131+
"forecast_table_file__modified_by",
125132
),
126133
),
127134
)

0 commit comments

Comments
 (0)