DEP: Add event details on dref and field report#2708
Draft
sudip-khanal wants to merge 3 commits intoproject/dref-emergency-pagesfrom
Draft
DEP: Add event details on dref and field report#2708sudip-khanal wants to merge 3 commits intoproject/dref-emergency-pagesfrom
sudip-khanal wants to merge 3 commits intoproject/dref-emergency-pagesfrom
Conversation
- Replace MiniEventSerializer to ListEventSerializer on FieldReportSerializer - Add event filter on field report api
susilnem
requested changes
Apr 9, 2026
Member
susilnem
left a comment
There was a problem hiding this comment.
We need to do a catch up regarding the changes that has been done into this pull request.
| districts_details = MiniDistrictSerializer(source="districts", many=True, read_only=True) | ||
| regions_details = RegionSerializer(source="regions", many=True, read_only=True) | ||
| event_details = MiniEventSerializer(source="event", read_only=True) | ||
| event_details = ListEventSerializer(source="event", read_only=True) |
Member
There was a problem hiding this comment.
Any reason on changing it to ListEventSerializer?
| count += 1 | ||
|
|
||
| Dref.objects.bulk_update(drefs, ["event"]) | ||
| self.stdout.write(self.style.SUCCESS(f"Updated {count} Dref records with related Event")) |
Member
There was a problem hiding this comment.
Suggested change
| self.stdout.write(self.style.SUCCESS(f"Updated {count} Dref records with related Event")) | |
| updated_dref_count = Dref.objects.bulk_update(drefs, ["event"]) | |
| self.stdout.write(self.style.SUCCESS(f"Updated {updated_dref_count} Dref records with related Event")) |
|
|
||
| drefs = Dref.objects.exclude(appeal_code__isnull=True) | ||
| self.stdout.write(self.style.NOTICE(f"Total Dref records with appeal code:{drefs.count()}")) | ||
| count = 0 |
| event_id = appeal_map.get(dref.appeal_code) | ||
| if event_id: | ||
| dref.event = event_id | ||
| count += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Drefmodule and update the related api's to add event detailsChecklist
Things that should succeed before merging.
Release
If there is a version update, make sure to tag the repository with the latest version.