CodeDrift
V2EX  ›  问与答

想问一下 django 分页的问题

  •  
  •   CodeDrift · Apr 28, 2015 · 2002 views
    This topic created in 4060 days ago, the information mentioned may be changed or developed.

    我在后台查询渲染出了html数据例如
    <tr>
    <td>123213</td>
    </tr>

    这样的。有多,例如3000+数据。然后渲染到前台render
    在前台{{html|safe}}来生成数据,那么请问怎么能分页呢?

    5 replies    2015-04-29 17:49:15 +08:00
    junnplus
        2
    junnplus  
       Apr 28, 2015
    如果是table的话,数据量不是特别大的话可以用js分页
    CodeDrift
        3
    CodeDrift  
    OP
       Apr 29, 2015
    @guoqiao 这个不行吧。这个是后台获得数据,然后传给模板来分页。。
    我这里是后台写好了html,传给模板了。。想分页。。
    CodeDrift
        4
    CodeDrift  
    OP
       Apr 29, 2015
    @junnplus 还是后台写了方法进行分页了。。谢谢先
    junnplus
        5
    junnplus  
       Apr 29, 2015
    @Anybfans 我写flask的,原先也是后台写分页,最后都改成前台分页,因为我的数据都是显示在table里面的,有个比较好的插件
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1099 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 18:20 · PVG 02:20 · LAX 11:20 · JFK 14:20
    ♥ Do have faith in what you're doing.