Skip to content

Commit

Permalink
Renamed StripeModel.djstripe_data to stripe_data
Browse files Browse the repository at this point in the history
  • Loading branch information
arnav13081994 authored and jleclanche committed Apr 25, 2024
1 parent 7fcc44f commit b8fa38f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion djstripe/admin/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def lookups(self, request, model_admin):
statuses = [
[x, x.replace("_", " ").title()]
for x in models.Subscription.objects.values_list(
"djstripe_data__status", flat=True
"stripe_data__status", flat=True
).distinct()
]
statuses.append(["none", "No Subscription"])
Expand Down
6 changes: 3 additions & 3 deletions djstripe/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def business_url(self) -> str:
"""
The business's publicly available website.
"""
business_profile = self.djstripe_data.get("business_profile")
business_profile = self.stripe_data.get("business_profile")
if business_profile:
return business_profile.get("url", "")
return ""
Expand Down Expand Up @@ -91,8 +91,8 @@ def get_or_retrieve_for_api_key(cls, api_key: str):
return apikey_instance.djstripe_owner_account

def __str__(self):
settings = self.djstripe_data.get("settings") or {}
business_profile = self.djstripe_data.get("business_profile") or {}
settings = self.stripe_data.get("settings") or {}
business_profile = self.stripe_data.get("business_profile") or {}
return (
settings.get("dashboard", {}).get("display_name")
or business_profile.get("name")
Expand Down
6 changes: 3 additions & 3 deletions djstripe/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class StripeBaseModel(models.Model):

djstripe_created = models.DateTimeField(auto_now_add=True, editable=False)
djstripe_updated = models.DateTimeField(auto_now=True, editable=False)
djstripe_data = JSONField(default=dict)
stripe_data = JSONField(default=dict)

class Meta:
abstract = True
Expand Down Expand Up @@ -348,8 +348,8 @@ def _stripe_object_to_record(
% (manipulated_data.get("object", ""), cls.__name__)
)

# By default we put the raw stripe data in the djstripe_data json field
result = {"djstripe_data": data}
# By default we put the raw stripe data in the stripe_data json field
result = {"stripe_data": data}

if current_ids is None:
current_ids = set()
Expand Down
4 changes: 2 additions & 2 deletions docs/history/3_0_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Release highlights

- A new field `djstripe_data` json field has been added to all
- A new field `stripe_data` json field has been added to all
supported models. This field contains a copy of the entire object as-is in the Stripe
API.

Expand All @@ -16,7 +16,7 @@

!!! attention

Many superfluous model fields have been removed, in favour of using `djstripe_data`.
Many superfluous model fields have been removed, in favour of using `stripe_data`.
We retain model fields for useful foreign keys and other frequently-used fields.

- Migrations have been reset.
Expand Down

0 comments on commit b8fa38f

Please sign in to comment.