摘要: 前端 {% extends 'layout.html' %} {% load static %} {% block content %} <div class="panel panel-default"> <!-- Default panel contents --> <div class="pan 阅读全文
posted @ 2022-09-19 17:10 Sherwin_szw 阅读(35) 评论(0) 推荐(0)
摘要: django 后端逻辑 def transaction_add(request, pk): res_code = ResCode() if request.method == 'POST': form = TransactionForm(data=request.POST) if not form. 阅读全文
posted @ 2022-09-17 18:27 Sherwin_szw 阅读(47) 评论(0) 推荐(0)
摘要: 前端js <script> $(function () { $("#addBtn").click(function () { $("#addModal").modal('show') }) $("#submitBtn").click(function () { $.ajax({ url: "{% u 阅读全文
posted @ 2022-09-17 12:53 Sherwin_szw 阅读(34) 评论(0) 推荐(0)
摘要: model class TransactionRecord(ActiveBaseModel): status_class_mapping = { 1: 'info', 2: 'danger', 3: 'success', 4: 'primary', 5: 'warning', } choice_st 阅读全文
posted @ 2022-09-16 15:01 Sherwin_szw 阅读(64) 评论(0) 推荐(0)
摘要: 前端按钮 {% edit_btn request 'user_edit' pk=user.id %} 后端逻辑 @register.simple_tag def edit_btn(request, url_name, *args, **kwargs): if not check_per(reques 阅读全文
posted @ 2022-09-15 20:02 Sherwin_szw 阅读(37) 评论(0) 推荐(0)
摘要: 前端 {% load btnPermission %} {% add_btn request 'level_add' %} {% edit_btn request 'level_edit' pk=user_level.id %} {% delete_btn request 'level_delete 阅读全文
posted @ 2022-09-15 08:22 Sherwin_szw 阅读(45) 评论(0) 推荐(0)
摘要: 模态框部分 <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog modal-s 阅读全文
posted @ 2022-09-14 07:43 Sherwin_szw 阅读(49) 评论(0) 推荐(0)
摘要: 添加按钮 <div class="pull-left"><a href="{% url 'price_policy_add' %}" class="btn-success btn" style="margin-bottom: 10px"><i class="fa fa-plus-square-o"> 阅读全文
posted @ 2022-09-13 20:59 Sherwin_szw 阅读(32) 评论(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 }} 阅读全文
posted @ 2022-09-13 20:39 Sherwin_szw 阅读(46) 评论(0) 推荐(0)
摘要: 前端 <nav aria-label="Page navigation"> <ul class="pagination"> {{ html_str }} </ul> </nav> 后端 分页组件 from django.utils.safestring import mark_safe import 阅读全文
posted @ 2022-09-13 17:12 Sherwin_szw 阅读(22) 评论(0) 推荐(0)