2022-09-13 20:39阅读: 40评论: 0推荐: 0

列表查询

前端

<table class="table table-hover table-bordered">
        <tr>
            <th>序号</th>
            <th>数量</th>
            <th>价格</th>
        </tr>
        {% for one in queryset %}
            <tr user-id="{{ one.id }}">
                <td>{{ one.id }}</td>
                <td>{{ one.count }}</td>
                <td>{{ one.price }}</td>
            </tr>
        {% endfor %}
    </table>

后端

def price_policy_list(request):
    if request.method == 'GET':
        queryset = models.PricePolicy.objects.all()
        context = {
            'queryset': queryset
        }
        return render(request, 'pricePolicy/list.html', context)

本文作者:Sherwin

本文链接:https://www.cnblogs.com/sherwin1995/p/16690761.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   Sherwin_szw  阅读(40)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.