Example Code Portion:
class ItemWarehouseTxn(models.Model):
STOCK_IN = 1
STOCK_OUT = 2
TXN_TYPE_CHOICES = [
(STOCK_IN,'STOCK-IN'),
(STOCK_OUT,'STOCK-OUT'),
]
txn_type = models.IntegerField(verbose_name="Transaction Type", choices=TXN_TYPE_CHOICES, default=STOCK_IN)
Problem:
When the list table is displayed, it only shows in the table the integer values
What to solve:
To allow to display the string value pair rather than integers (1, 2), show the string values (STOCK-IN, STOCK-OUT).
Solution:
?
Example Code Portion:
class ItemWarehouseTxn(models.Model):
Problem:
When the list table is displayed, it only shows in the table the integer values
What to solve:
To allow to display the string value pair rather than integers (1, 2), show the string values (STOCK-IN, STOCK-OUT).
Solution:
?