PAYCODE_BLUEPAY = "BLUEPAY"
PAYCODE_HEARTLAND = "HEARTLAND"
PAYCODE_1STPAY = "1STPAYMENT"
PAYCODE_CHOICES =(
(PAYCODE_1STPAY, '1St Payment'),
(PAYCODE_BLUEPAY, 'Bluepay Payment'),
(PAYCODE_HEARTLAND, 'HeartLand Payment'),
)
class Payment(models.Model):
paymentmethod = models.CharField("Payment Method", max_length=20, choices = PAYCODE_CHOICES, blank=False, null=False)
def __str__(self):
return self.paymentmethod
The method __str__(self)
will return BLUEPAY
or HEARTLAND
or 1STPAYMENT
. But I want __str__(self)
return 1St Payment, Bluepay Payment or HeartLand Payment.
Please give me solution. Thanks.