Skip to content

Instantly share code, notes, and snippets.

@mlissner
Created December 30, 2014 18:49
Show Gist options
  • Save mlissner/86f9c8dcc536bbf5410b to your computer and use it in GitHub Desktop.
Save mlissner/86f9c8dcc536bbf5410b to your computer and use it in GitHub Desktop.
How do I make line 9 work?
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