From 4e835b82c51a45fdb0f6728d62d5566082891978 Mon Sep 17 00:00:00 2001 From: Michal Proszek Date: Tue, 2 Jul 2019 08:53:55 +0200 Subject: [PATCH 1/2] Improve Stripe Charge admin --- aa_stripe/admin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aa_stripe/admin.py b/aa_stripe/admin.py index 8835045..a1f0db0 100644 --- a/aa_stripe/admin.py +++ b/aa_stripe/admin.py @@ -44,7 +44,9 @@ class StripeCustomerAdmin(ReadOnly): class StripeChargeAdmin(ReadOnly): - list_display = ("id", "user", "customer", "created", "updated", "object_id", "is_charged", "amount") + search_fields = ("user__email",) + list_display = ("id", "user", "created", "updated", "object_id", "is_charged", "amount") + list_filter = ("created", "updated", "is_charged") ordering = ("-created",) From e70772668c3819bc371d1d2422d66b9f81dfa312 Mon Sep 17 00:00:00 2001 From: Michal Proszek Date: Tue, 2 Jul 2019 09:06:27 +0200 Subject: [PATCH 2/2] changes --- CHANGELOG.txt | 4 ++++ aa_stripe/__init__.py | 4 ++-- aa_stripe/admin.py | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 7fa810a..a3ea27e 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ # Change Log All notable changes to this project will be documented in this file. +## [0.8.3] +### Added +- filters to admin StripeCharge list + ## [0.8.2] ### Added - Signal "stripe_charge_refunded" on refund diff --git a/aa_stripe/__init__.py b/aa_stripe/__init__.py index 0f62407..28225ba 100644 --- a/aa_stripe/__init__.py +++ b/aa_stripe/__init__.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- __title__ = "Arabella Stripe" -__version__ = "0.8.2" +__version__ = "0.8.3" __author__ = "Jacek Ostanski" __license__ = "MIT" -__copyright__ = "Copyright 2017 Arabella" +__copyright__ = "Copyright 2019 Arabella" # Version synonym VERSION = __version__ diff --git a/aa_stripe/admin.py b/aa_stripe/admin.py index a1f0db0..2f2028a 100644 --- a/aa_stripe/admin.py +++ b/aa_stripe/admin.py @@ -44,11 +44,15 @@ class StripeCustomerAdmin(ReadOnly): class StripeChargeAdmin(ReadOnly): - search_fields = ("user__email",) - list_display = ("id", "user", "created", "updated", "object_id", "is_charged", "amount") + search_fields = ("user__email", "customer__stripe_customer_id") + list_display = ("id", "user", "stripe_customer_id", "created", "updated", "object_id", "is_charged", "amount") list_filter = ("created", "updated", "is_charged") ordering = ("-created",) + def stripe_customer_id(self, obj): + if obj.customer: + return obj.customer.stripe_customer_id + class StripeCouponAdmin(admin.ModelAdmin): form = StripeCouponForm