标签:__init__ erro 图层 elf workspace model nbsp mode django
File "D:\workspace\mall\venv\lib\site-packages\django\db\models\fields\__init__.py", line 972, in get_prep_value
return int(value)
ValueError: invalid literal for int() with base 10: ‘xxx‘
视图层拦截:
class PickleView(APIView): def get(self,request,*args,**kwargs): if kwargs.get("id"): if not isinstance(kwargs.get("id"),int): return Response(data={"msg": "not found", "data": []}, status=200)
Django ValueError: invalid literal for int() with base 10: 'xxx'解决办法
标签:__init__ erro 图层 elf workspace model nbsp mode django
原文地址:https://www.cnblogs.com/SunshineKimi/p/14044225.html