会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Sherwin
首页
管理
上一页
1
···
10
11
12
13
14
15
下一页
2022年9月19日
modal编辑ajax
摘要: 前端 {% 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)
2022年9月17日
数据库操作的事务与锁
摘要: 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)
django ajax提交
摘要: 前端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)
2022年9月16日
修改modelForm的字段choices显示
摘要: 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)
2022年9月15日
跳转携带条件
摘要: 前端按钮 {% 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)
2022年9月14日
modal 删除
摘要: 模态框部分 <!-- 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)
2022年9月13日
添加/修改表单
摘要: 添加按钮 <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)
上一页
1
···
10
11
12
13
14
15
下一页