上一页 1 2 3 4 5 6 7 8 ··· 16 下一页
摘要: 前端传一个需要删除的id,list,后端拿到这个list进行删除 1 class DeleteLinkMoreDataJson(APIView): 2 3 def post(self, request): 4 data = simplejson.loads(request.body) 5 data_ 阅读全文
posted @ 2020-05-07 17:03 小心走火 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 由前端写 阅读全文
posted @ 2020-05-07 17:02 小心走火 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 单条数据编辑 1 class EditLinkJson(APIView): 2 3 def post(self, request): 4 json_data = simplejson.loads(request.body) 5 print(json_data) 6 try: 7 id = Link. 阅读全文
posted @ 2020-05-07 17:00 小心走火 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 1 from rest_framework.views import APIView 2 3 4 class DeleteLinkDataJson(APIView): 5 6 def post(self, request): 7 # 获取ulr中的参数 request.path 8 id = req 阅读全文
posted @ 2020-05-07 16:56 小心走火 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 1 from rest_framework.views import APIView 2 import simplejson 3 4 5 class AddLinkJson(APIView): 6 7 def post(self, request): 8 json_data = simplejson 阅读全文
posted @ 2020-05-07 16:54 小心走火 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 1 from rest_framework.views import APIView 2 3 4 class GetLinkListDataJson(APIView): 5 """ 6 列表页获取table信息,包含分页 7 """ 8 def get(self, request): 9 page 阅读全文
posted @ 2020-05-07 16:52 小心走火 阅读(623) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding: utf-8 -*- 2 from dss.Serializer import serializer 3 from django.http import HttpResponse 4 5 6 def response_as_json(data, foreign_pene 阅读全文
posted @ 2020-05-07 16:49 小心走火 阅读(1075) 评论(0) 推荐(0) 编辑
摘要: 背景: 需要做一个列表页,管理内部所有链接 思路:先用前端画出列表页,然后实现列表的功能 列表页:layui自带的方法渲染,不需要过多的HTML直接JS渲染 功能:新增、删除、查看、编辑、搜索、分页 功能实现:前端数据提供给后端处理,渲染返回结果 首先,上一段前端代码,具体解析在页面中有注释 更新数 阅读全文
posted @ 2020-05-07 16:45 小心走火 阅读(1951) 评论(3) 推荐(0) 编辑
摘要: .......开发页面,省略 1、设置settings ALLOWED_HOSTS = ['127.0.0.1', 'localhost', 'XXX.168.XX.XXX', '*', ] 2、使用终端开启本地服务 Python manage.py runserver XXX.168.XX.XXX 阅读全文
posted @ 2020-05-07 15:39 小心走火 阅读(1417) 评论(0) 推荐(0) 编辑
摘要: 背景: 在使用Django做列表页时,需要用到增删改查,在新增的时候用到了layui.open的弹出层。将新增页面当做一个iframe嵌入到列表页,使用layui.open的btn制作按钮,并且实现提交表单的功能 实现: 先用HTML话列表页和新增页面的图表,列表页 1 {% extends 'le 阅读全文
posted @ 2020-05-04 15:23 小心走火 阅读(1833) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 16 下一页