Skip to content

Commit

Permalink
Allow student ordering in scores admin
Browse files Browse the repository at this point in the history
  • Loading branch information
maxicecilia committed May 30, 2015
1 parent 8bdbb23 commit 327564a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion simple_classroom/apps/classroom/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,8 @@ class ScoreAdmin(admin.ModelAdmin):
}

def student_full_name(self, obj):
return obj.enrolled.student_profile.user.get_full_name()
return u'{}, {}'.format(
obj.enrolled.student_profile.user.last_name.title(),
obj.enrolled.student_profile.user.first_name.title())
student_full_name.short_description = _(u'Alumno')
student_full_name.admin_order_field = 'enrolled__student_profile__user__last_name'

0 comments on commit 327564a

Please sign in to comment.