Improve string representation of the billing address
This commit is contained in:
parent
922fea3bf4
commit
69061c016b
1 changed files with 8 additions and 2 deletions
|
@ -20,7 +20,10 @@ class BaseBillingAddress(models.Model):
|
|||
|
||||
class BillingAddress(BaseBillingAddress):
|
||||
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):
|
||||
|
@ -28,7 +31,10 @@ class UserBillingAddress(BaseBillingAddress):
|
|||
current = models.BooleanField(default=True)
|
||||
|
||||
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):
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue