Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gender to person CSV #1061

4 changes: 3 additions & 1 deletion members/admin/person_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def export_emaillist(self, request, queryset):
export_emaillist.short_description = "Exporter e-mail liste"

def export_csv(self, request, queryset):
result_string = "Navn;Alder;Opskrevet;Tlf (barn);Email (barn);"
result_string = "Navn;Alder;Køn;Opskrevet;Tlf (barn);Email (barn);"
result_string += "Tlf (forælder);Email (familie);Postnummer;Noter\n"
for person in queryset:
parent = person.family.get_first_parent()
Expand All @@ -190,6 +190,8 @@ def export_csv(self, request, queryset):
+ ";"
+ str(person.age_years())
+ ";"
+ str(person.gender_text())
+ ";"
+ str(person.added_at.strftime("%Y-%m-%d %H:%M"))
+ ";"
+ person.phone
Expand Down
Loading