-1
我有IntegerField()的模型模型IntegerField()來Django的模板,有序
class Room(models.Model):
type = models.CharField(max_length=50)
floor = models.IntegerField()
,我想它與序數後綴,模板顯示。
{% for room in rooms %}
<div>
<p> {{ room.type }}</p>
<p> {{ room.floor }} </p>
</div>
{% endfor %}
我想這樣的地板輸出。
1st, 2nd, 3rd, 4th... 10th.. 12th.. 13th.. 15th...
這是好的,非常感謝 –