Mercurial > public > sg101
changeset 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 | b559fbc7a236 |
children | a130444fb16b |
files | donations/admin.py sg101/templates/donations/index.html |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/donations/admin.py Sat Oct 19 11:32:35 2013 -0500 +++ b/donations/admin.py Thu Oct 24 21:03:03 2013 -0500 @@ -1,10 +1,13 @@ """ This file contains the admin definitions for the donations application. + """ from django.contrib import admin from donations.models import Donation class DonationAdmin(admin.ModelAdmin): - raw_id_fields = ('user', ) + raw_id_fields = ['user'] + date_hierarchy = 'payment_date' + list_display = ['__unicode__', 'payer_email', 'payment_date', 'memo'] admin.site.register(Donation, DonationAdmin)
--- a/sg101/templates/donations/index.html Sat Oct 19 11:32:35 2013 -0500 +++ b/sg101/templates/donations/index.html Thu Oct 24 21:03:03 2013 -0500 @@ -81,7 +81,7 @@ <li><input name="item_number" type="radio" value="{{ item_number }}" id="name_yes" /> <label for="name_yes">Yes, list my name as gathered from Paypal</label></li> {% endif %} - <li><input name="item_number" type="radio" value="{{ item_anon_number }}" id="name_no" /> + <li><input name="item_number" type="radio" value="{{ item_anon_number }}" checked="checked" id="name_no" /> <label for="name_no">No, list me as {{ anonymous }}</label></li> </ul> <input type="hidden" name="cmd" value="_donations" />