Skip to content

Integer Choice Fields Display, How to display the string value pair? #82

Description

@johnchrisnew

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:
?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions