当前位置:网站首页>Error reporting: when the browser clicks the modify add button, there is no response and no error reporting. Solution
Error reporting: when the browser clicks the modify add button, there is no response and no error reporting. Solution
2022-07-29 00:48:00 【:D...】
Pictured Clicking both buttons at the same time does not respond 
Ideas
Both modification and addition involve the data of model classes
1 Find add Or modified Back end code And Model class See if it existsForeign key field
2 There are foreign key fields Determine whether the front end uses the data of this field
3 If the data of the foreign key field is used Determine whether the method of obtaining foreign key field data is definedPager
4 If a pager is defined , In the modify and add buttons , Get theThe data is incomplete
terms of settlement
Define a separate view to get foreign key field information
You can use subviews ListAPIView
Modify the route for the front end to obtain foreign key fields
Example
# SKU View set
class SKUViewSet(ModelViewSet):
queryset = Good.objects.all()
serializer_class = Good_Serializer
lookup_field = 'pk'
lookup_url_kwarg = 'pk'
pagination_class = Page
# Get all SKU Do not inherit the pager
class SKUList(ListAPIView):
queryset = Good.objects.all()
serializer_class = Good_Serializer
边栏推荐
- Talk about seven ways to realize asynchronous programming
- [network security] complete the blacklist and whitelist functions of server firewall through iptables and ipset
- SAP VL02N 交货单过账函数 WS_DELIVERY_UPDATE
- 主线程与守护线程
- 【esn】 学习回声状态网络
- PTA (daily question) 7-69 narcissus number
- MySQL的隔离级别、可能出现的问题(脏读、不可重复读、幻读)及其解决方法
- (20211130更新)关于jupyter notebook的下载安装及自己的配置、主题
- SDRAM控制器设计(数字控制器的两种设计方法)
- 面试被问到了String相关的几道题,你能答上来吗?
猜你喜欢

【飞控开发基础教程8】疯壳·开源编队无人机-I2C(激光测距)

Basic knowledge of PHP language (super detailed)

Dynamic programming (V)

110 MySQL interview questions and answers (continuously updated)

分布式限流 redission RRateLimiter 的使用及原理

时间序列数据的预处理方法总结

Anomaly detection and unsupervised learning (1)

乱打日志的男孩运气怎么样我不知道,加班肯定很多!

Outlier detection and open set identification (1)

Longest ascending subsequence
随机推荐
armeabi-v7a架构(sv7a)
Introduction and solution of common security vulnerabilities in Web System SQL injection
Outlier detection and Gan network (1)
PTA (daily question) 7-73 turning triangle
Upload Excel files with El upload and download the returned files
(20211130更新)关于jupyter notebook的下载安装及自己的配置、主题
2022dasctfjuly empowerment competition (reappearance)
How to solve Oracle not available
[basic course of flight control development 8] crazy shell · open source formation uav-i2c (laser ranging)
Recursion / backtracking (Part 2)
将Word中的表格以图片形式复制到微信发送
About 1931cie -- conversion of XYZ color coordinate graph to RGB color coordinate relationship
I don't recommend you use Select*
Mock.js essay
Still writing a lot of if to judge? A rule executor kills all if judgments in the project
CUDA related
CDN mode uses vant components, and components cannot be called after they are introduced
What are the skills of API interface optimization?
第二轮1000个Okaleido Tiger,再次登录Binance NFT 1小时售罄
C语言括号匹配(栈括号匹配c语言)