Skip to content

Commit

Permalink
Merge branch 'master' into templatetags
Browse files Browse the repository at this point in the history
  • Loading branch information
paltman authored Dec 13, 2016
2 parents a0de07e + 8333755 commit 885a461
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 additions & 3 deletions pinax/stripe/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
from .models import ( # @@@ make all these read-only
Charge,
Subscription,
Card,
BitcoinReceiver,
Customer,
Event,
EventProcessingException,
Invoice,
InvoiceItem,
Plan,
Transfer
Transfer,
TransferChargeFee
)


Expand Down Expand Up @@ -175,6 +178,20 @@ def queryset(self, request, queryset):

class SubscriptionInline(admin.TabularInline):
model = Subscription
extra = 0
max_num = 0


class CardInline(admin.TabularInline):
model = Card
extra = 0
max_num = 0


class BitcoinReceiverInline(admin.TabularInline):
model = BitcoinReceiver
extra = 0
max_num = 0


def subscription_status(obj):
Expand Down Expand Up @@ -203,12 +220,18 @@ def subscription_status(obj):
search_fields=[
"stripe_id",
] + user_search_fields(),
inlines=[SubscriptionInline]
inlines=[
SubscriptionInline,
CardInline,
BitcoinReceiverInline
]
)


class InvoiceItemInline(admin.TabularInline):
model = InvoiceItem
extra = 0
max_num = 0


def customer_has_card(obj):
Expand Down Expand Up @@ -256,7 +279,9 @@ def customer_user(obj):
"period_end",
"total"
],
inlines=[InvoiceItemInline]
inlines=[
InvoiceItemInline
]
)

admin.site.register(
Expand Down Expand Up @@ -290,6 +315,13 @@ def customer_user(obj):
],
)


class TransferChargeFeeInline(admin.TabularInline):
model = TransferChargeFee
extra = 0
max_num = 0


admin.site.register(
Transfer,
raw_id_fields=["event"],
Expand All @@ -303,5 +335,8 @@ def customer_user(obj):
search_fields=[
"stripe_id",
"event__stripe_id"
],
inlines=[
TransferChargeFeeInline
]
)

0 comments on commit 885a461

Please sign in to comment.