[Answer]-Displaying a different name in django admin

1👍

Set verbose_name on the dollar_amount field to “price.”

Edit:

class PurchaseOrder(models.Model):
    product = models.CharField(max_length=256)
    dollar_amount = models.FloatField(verbose_name='Price')

0👍

in models.py:

class PurchaseOrder(models.Model):
  product = models.CharField(max_length=256)
  dollar_amount = models.FloatField()

  def price(self):
    return self.dollar_amount

in admin.py:

 class PurchaseOrderAdmin(admin.ModelAdmin):
  list_display=('product','price')

Leave a comment