【发布时间】:2020-06-07 08:21:00
【问题描述】:
我正在寻找最简单的方法来对齐右 django 十进制字段。 有人可以指出正确的方法吗? 我找到了不同的帖子,但它仍然显示为左对齐。 我是否必须覆盖管理员,或者我直接在管理员中错过了一些简单的功能。
我想让 3 列(ore_dovute、totale、ore_eccedenti)右对齐,并根据我的需要使用正确的格式。
class TotaliManager(models.Model):
utente_id = models.IntegerField(max_length=11,null=True)
ore_dovute = models.DecimalField('ore dovute',max_digits=5,decimal_places=2,null=True)
totale = models.DecimalField('ore effettuate',max_digits=5,decimal_places=2,null=True)
ore_eccedenti = models.DecimalField('ore eccedenti',max_digits=5,decimal_places=2,null=True)
class Meta:
verbose_name_plural = "Totali per anno / mese"
非常感谢
【问题讨论】:
-
你说的是管理员列表显示吗?
-
是的!这是关于列表显示而不是输入。