From d2b62182d243f997ed4cff6691706e1e3cd20b63 Mon Sep 17 00:00:00 2001 From: orzubalsky Date: Fri, 31 Jan 2014 22:56:03 -0500 Subject: [PATCH] adding email field to registration inline form in admin. closes #76 --- ts/apps/tradeschool/admin.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ts/apps/tradeschool/admin.py b/ts/apps/tradeschool/admin.py index c04b8924..7c2212d6 100644 --- a/ts/apps/tradeschool/admin.py +++ b/ts/apps/tradeschool/admin.py @@ -466,14 +466,27 @@ def registration_link(self, obj): ) registration_link.short_description = _('Title') + def student_email_link(self, obj): + """ + Return an anchor tag with the registered student's email. + """ + # return a safe output so the html can be rendered in the template + return mark_safe( + '%s' % ( + obj.student.email, obj.student.email) + ) + student_email_link.short_description = _('Email') + model = Registration readonly_fields = ( 'registration_link', + 'student_email_link', 'items', 'registration_status' ) fields = ( 'registration_link', + 'student_email_link', 'items', 'registration_status', )