summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshen2018-02-12 10:51:38 +0530
committerGitHub2018-02-12 10:51:38 +0530
commit71b90d34ef823839776851440c48a11628f60ff3 (patch)
treed98ad1887000a1f8d29572e34a6f6cd143925c6f
parent3221a51164b53170c6506c71ef22865737fd1356 (diff)
parentb944fd4895db0a542aebd44206c3c508dd5c3c50 (diff)
downloadworkshop_booking-71b90d34ef823839776851440c48a11628f60ff3.tar.gz
workshop_booking-71b90d34ef823839776851440c48a11628f60ff3.tar.bz2
workshop_booking-71b90d34ef823839776851440c48a11628f60ff3.zip
Merge pull request #38 from Akshen/develop
Add First and Last name column while downloading profile data
-rw-r--r--workshop_app/admin.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/workshop_app/admin.py b/workshop_app/admin.py
index a28cdb3..40d496f 100644
--- a/workshop_app/admin.py
+++ b/workshop_app/admin.py
@@ -14,7 +14,8 @@ except ImportError:
#Custom Classes
class ProfileAdmin(admin.ModelAdmin):
- list_display = ['title','user', 'institute','location','department','phone_number','position']
+ list_display = ['title','user', 'institute','location','department',
+ 'phone_number','position']
list_filter = ['position', 'department']
actions = ['download_csv']
@@ -25,11 +26,13 @@ class ProfileAdmin(admin.ModelAdmin):
filename=profile_data.csv'
writer = csv.writer(response)
- writer.writerow(['title','user', 'institute', 'location','department','phone_number',
- 'position'])
+ writer.writerow(['title','username', 'first_name', 'last_name',
+ 'institute', 'location', 'department',
+ 'phone_number', 'position'])
for q in queryset:
- writer.writerow([q.title, q.user, q.institute,
+ writer.writerow([q.title, q.user, q.user.first_name,
+ q.user.last_name, q.institute,
q.location, q.department, q.phone_number,
q.position])