forked from dj-stripe/dj-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement ScheduledQueryRun Sigma model
This upgrades stripe python dependency to 2.3.0 Closes dj-stripe#673
- Loading branch information
1 parent
9b0deef
commit ccc61a2
Showing
6 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
# TODO: class ScheduledQuery | ||
import stripe | ||
from django.db import models | ||
|
||
from .. import enums | ||
from ..fields import JSONField, StripeDateTimeField, StripeEnumField | ||
from .base import StripeModel | ||
|
||
|
||
class ScheduledQueryRun(StripeModel): | ||
""" | ||
Stripe documentation: https://stripe.com/docs/api#scheduled_queries | ||
""" | ||
stripe_class = stripe.sigma.ScheduledQueryRun | ||
|
||
data_load_time = StripeDateTimeField( | ||
help_text="When the query was run, Sigma contained a snapshot of your Stripe data at this time." | ||
) | ||
error = JSONField( | ||
null=True, blank=True, | ||
help_text="If the query run was not succeesful, contains information about the failure." | ||
) | ||
file = models.ForeignKey( | ||
"FileUpload", on_delete=models.SET_NULL, null=True, blank=True, | ||
help_text="The file object representing the results of the query." | ||
) | ||
result_available_until = StripeDateTimeField( | ||
help_text="Time at which the result expires and is no longer available for download." | ||
) | ||
sql = models.CharField(max_length=5000, help_text="SQL for the query.") | ||
status = StripeEnumField(enum=enums.ScheduledQueryRunStatus, help_text="The query's execution status.") | ||
title = models.CharField(max_length=5000, help_text="Title of the query.") |
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