Py学习  »  问与答

Django后台DateTimeField字段如何控制输出格式?

cumt_ttr • 9 年前 • 9154 次点击  

enter image description here

比如,我想更改成2014-10-7 10:59 这个地方的模板是change_list_results.html里的,具体的代码就是

{% for result in results %}
{% if result.form.non_field_errors %}
    <tr><td colspan="{{ result|length }}">{{ result.form.non_field_errors }}</td></tr>
{% endif %}
<tr class="{% cycle 'row1' 'row2' %}">{% for item in result %}{{ item }}{% endfor %}</tr>
{% endfor %}

完全不知道该如何定制。。。。。。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/694
 
9154 次点击  
文章 [ 1 ]  |  最新文章 9 年前
cumt_ttr
Reply   •   1 楼
cumt_ttr    9 年前

找到解决办法了 http://stackoverflow.com/questions/7216764/in-the-django-admin-site-how-do-i-change-the-display-format-of-time-fields