add def get_email() to get email

This commit is contained in:
Thomas Steen Rasmussen 2016-06-04 09:46:10 +02:00
parent 731c7bd2a5
commit fc077a43df

View file

@ -39,10 +39,14 @@ class TicketInline(admin.TabularInline):
@admin.register(models.Order) @admin.register(models.Order)
class OrderAdmin(admin.ModelAdmin): class OrderAdmin(admin.ModelAdmin):
change_form_template = 'admin/change_order_form.html' change_form_template = 'admin/change_order_form.html'
def get_email(self, obj):
return obj.user.email
list_display = [ list_display = [
'id', 'id',
'user', 'user',
'user__email', 'get_email',
'total', 'total',
'payment_method', 'payment_method',
'open', 'open',