Improve string representation of the billing address

This commit is contained in:
PCoder 2019-12-17 18:45:29 +05:30
parent 922fea3bf4
commit 69061c016b

View file

@ -20,7 +20,10 @@ class BaseBillingAddress(models.Model):
class BillingAddress(BaseBillingAddress): class BillingAddress(BaseBillingAddress):
def __str__(self): def __str__(self):
return self.street_address return "%s, %s, %s, %s, %s" % (
self.cardholder_name, self.street_address, self.city,
self.postal_code, self.country
)
class UserBillingAddress(BaseBillingAddress): class UserBillingAddress(BaseBillingAddress):
@ -28,7 +31,10 @@ class UserBillingAddress(BaseBillingAddress):
current = models.BooleanField(default=True) current = models.BooleanField(default=True)
def __str__(self): def __str__(self):
return self.street_address return "%s, %s, %s, %s, %s" % (
self.cardholder_name, self.street_address, self.city,
self.postal_code, self.country
)
def to_dict(self): def to_dict(self):
return { return {