Django组权限创建的视图重复查询

时间:2018-11-25 20:46:20

标签: django

使用简单的CreateView:

class GroupCreateView(CreateView):
    model = Group
    fields = '__all__'
    template_name = 'group/add.html'
    success_url = reverse_lazy('group_list')

它创建重复的查询。全部都来自许可。如何减少查询

enter image description here

<div class="row">
    <div class="col-12">
        <form action="" method="post">
            {% csrf_token %}

            {{ form|crispy }}
            <button class="btn btn-primary">Submit</button>
        </form>
    </div>
</div>

0 个答案:

没有答案