djstripe.managers
dj-stripe model managers
ChargeManager
Bases: models.Manager
Manager used by models.Charge.
status is still a concrete column on Charge, but paid,
refunded, disputed, and amount_refunded were moved to
stripe_data in dj-stripe 2.10 and require JSON lookups.
disputed
disputed(self)
during
during(self, year, month)
Return Charges created during a certain month, in UTC.
Stripe stores created as a UTC Unix timestamp, so the month is
selected by an explicit UTC datetime range rather than the
timezone-sensitive created__year/__month lookups.
failed
failed(self)
paid_totals_for
paid_totals_for(self, year, month)
refunded
refunded(self)
succeeded
succeeded(self)
StripeModelManager
Bases: models.Manager
Manager used in StripeModel.
SubscriptionManager
Bases: models.Manager.from_queryset(SubscriptionQuerySet)
Manager used in models.Subscription.
active_plan_summary
active_plan_summary(self)
Return active Subscriptions with plan counts annotated.
canceled_plan_summary_for
canceled_plan_summary_for(self, year, month)
Return Subscriptions canceled within a time range with plan counts annotated.
churn
churn(self)
started_plan_summary_for
started_plan_summary_for(self, year, month)
Return started_during Subscriptions with plan counts annotated.
SubscriptionQuerySet
Bases: models.QuerySet
Composable filters for Subscription objects.
Most Subscription fields are read from stripe_data (a JSONField) since
the dj-stripe 2.10 refactor removed them as concrete columns. ORM filters
must therefore use stripe_data__<key> lookups. Date-like fields are
stored as Unix timestamps in the JSON.
active
active(self)
Return active Subscriptions.
canceled
canceled(self)
Return canceled Subscriptions.
canceled_during
canceled_during(self, year, month)
Return Subscriptions canceled during a certain time range.
expiring_trials
expiring_trials(self, days = 7)
Return trials ending within days days.
for_product
for_product(self, product)
Return Subscriptions containing a Price for product.
incomplete
incomplete(self)
Return incomplete Subscriptions.
past_due
past_due(self)
Return past-due Subscriptions.
period_current
period_current(self, at = None)
Return Subscriptions whose billing period or trial contains at.
scheduled_for_cancellation
scheduled_for_cancellation(self)
Return Subscriptions set to cancel at the end of their period.
started_during
started_during(self, year, month)
Return Subscriptions not in trial status between a certain time range.
trialing
trialing(self)
Return trialing Subscriptions.
with_status
with_status(self, *statuses)
Return Subscriptions whose Stripe status is one of statuses.
TransferManager
Bases: models.Manager
Manager used by models.Transfer.
Transfer-level fields (status, amount, failure_code) live in
stripe_data as of dj-stripe 2.10.
during
during(self, year, month)
Return Transfers created during a certain month, in UTC.
Stripe stores created as a UTC Unix timestamp, so the month is
selected by an explicit UTC datetime range rather than the
timezone-sensitive created__year/__month lookups.
failed
failed(self)
paid_totals_for
paid_totals_for(self, year, month)
pending
pending(self)