• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

学而精

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

Django forms,HTML 和 python 小数

小数:

from __future__ import division

这样用“/”就能生成小数

 

forms:

1. views中的方法传递值给template.

  例如return render_response(request, '*.html',{'top_content':top_list,'module': 'audit',,"most_one":most_one})

2. 在template中利用

  变量用“{{     }}", 比如 {{ most_one }}    

  most_one[0]用作most_one.0 / most_one.key

3. 调用方法

  <th>{% for item in most_one.2 %}
                  <li>{{ item }}</li>

    {% endfor %} 【别忘了!】
            </th>

 

HTML:

<table>表示一个表格

<tr>标示这个表格中间的一个行,必须在一个<table></table>里面

<td>标示行中的一个列,需要嵌套在<tr></tr>中间

<th>...</th> 定义表头单元格,粗体等

 

<table> 
<tr> 
<td></td>  (<th>文字</th>,单元格名称)
<td></td> 
</tr> 
</teble>

  

posted on 2012-07-28 03:29  Songhan  阅读(292)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3