Grants Admin: add AgeGroup to export
@@ -32,6 +32,7 @@ EXPORT_GRANTS_FIELDS = (
class GrantResource(ResourceUsersByIdsMixin):
search_field = "user_id"
+ age_group = Field()
has_sent_submission = Field()
submission_title = Field()
submission_tags = Field()
@@ -39,6 +40,9 @@ class GrantResource(ResourceUsersByIdsMixin):
submission_pycon_link = Field()
USERS_SUBMISSIONS: Dict[int, List[Submission]] = {}
+ def dehydrate_age_group(self, obj: Grant):
+ return Grant.AgeGroup(obj.age_group).label
+
def dehydrate_has_sent_submission(self, obj: Grant) -> str:
return "TRUE" if obj.user_id in self.USERS_SUBMISSIONS else "FALSE"
