Mercurial > public > sg101
comparison donations/admin.py @ 733:18e42866b34d
For #56, default to anonymous radio button on donations form.
Also improve the donations admin page with a date hierarchy and other fields
on the list display.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 24 Oct 2013 21:03:03 -0500 |
parents | ee87ea74d46b |
children |
comparison
equal
deleted
inserted
replaced
732:b559fbc7a236 | 733:18e42866b34d |
---|---|
1 """ | 1 """ |
2 This file contains the admin definitions for the donations application. | 2 This file contains the admin definitions for the donations application. |
3 | |
3 """ | 4 """ |
4 from django.contrib import admin | 5 from django.contrib import admin |
5 from donations.models import Donation | 6 from donations.models import Donation |
6 | 7 |
7 class DonationAdmin(admin.ModelAdmin): | 8 class DonationAdmin(admin.ModelAdmin): |
8 raw_id_fields = ('user', ) | 9 raw_id_fields = ['user'] |
10 date_hierarchy = 'payment_date' | |
11 list_display = ['__unicode__', 'payer_email', 'payment_date', 'memo'] | |
9 | 12 |
10 admin.site.register(Donation, DonationAdmin) | 13 admin.site.register(Donation, DonationAdmin) |