Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要显示如下列表:1,2,3 等,但显示为:0001,0001,0003 等
在 Django 中存在一个模板过滤器吗?
简化 karthikr 的答案,您可以利用已经提供的 django 模板标签之一来完成此操作:
{{ number|stringformat:"04d" }}
我得到无法转储匿名类错误。
我的模型中有以下方法。
def seating_for(active) ln = cache(col("lu", active)) do self.seat_list_for(active).where(seat_id: self.seat