Created
December 30, 2014 18:49
-
-
Save mlissner/86f9c8dcc536bbf5410b to your computer and use it in GitHub Desktop.
How do I make line 9 work?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from alert.donate.models import Donation | |
from alert.userHandling.models import UserProfile | |
class DonorInline(admin.TabularInline): | |
model = UserProfile.donation.through | |
max_num = 1 | |
raw_id_fields = ('donation',) | |
class DonationAdmin(admin.ModelAdmin): | |
readonly_fields = ( | |
'date_modified', | |
'date_created', | |
) | |
list_display = ( | |
'__str__', | |
'amount', | |
'payment_provider', | |
'status', | |
'date_created', | |
) | |
list_filter = ( | |
'payment_provider', | |
'status', | |
) | |
inlines = ( | |
DonorInline, | |
) | |
admin.site.register(Donation, DonationAdmin) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment