Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增配置时报错 #20

Closed
zhongw opened this issue Aug 3, 2020 · 2 comments
Closed

新增配置时报错 #20

zhongw opened this issue Aug 3, 2020 · 2 comments

Comments

@zhongw
Copy link

zhongw commented Aug 3, 2020

操作路径:admin/配置/增加配置
报错内容:


Request Method: | GET
-- | --
http://localhost:8000/admin/app/config/add/
3.0.8
TypeError
'NoneType' object is not subscriptable
D:\MrDP\Butterfly\app\ex_fields\widgets.py in render, line 60
D:\Develop\Pyenv\Butterfly\Scripts\python.exe
3.8.4
['D:\\MrDP\\Butterfly',  'C:\\Program Files\\JetBrains\\PyCharm Community Edition '  '2019.3.1\\plugins\\python-ce\\helpers\\pydev',  'D:\\MrDP\\Butterfly',  'C:\\Program Files\\JetBrains\\PyCharm Community Edition '  '2019.3.1\\plugins\\python-ce\\helpers\\third_party\\thriftpy',  'C:\\Program Files\\JetBrains\\PyCharm Community Edition '  '2019.3.1\\plugins\\python-ce\\helpers\\pydev',  'C:\\Users\\ZhongWei\\AppData\\Local\\JetBrains\\PyCharmCE2020.2\\cythonExtensions',  'D:\\Develop\\Pyenv\\Butterfly\\Scripts\\python38.zip',  'c:\\python38\\DLLs',  'c:\\python38\\lib',  'c:\\python38',  'D:\\Develop\\Pyenv\\Butterfly',  'D:\\Develop\\Pyenv\\Butterfly\\lib\\site-packages',  'D:\\Develop\\Pyenv\\Butterfly\\lib\\site-packages\\django_editormd-0.4.1-py3.8.egg',  'D:\\Develop\\Pyenv\\Butterfly\\lib\\site-packages\\django_choices_enums-1.0.3-py3.8.egg']
星期一, 3 八月 2020 12:37:28 +0800

image

@gojuukaze
Copy link
Owner

gojuukaze commented Aug 3, 2020

不能这样新增配置,要新增配置的话需要写代码添加

如:

python manage.py shell
In [1]: from app.app_models.config_model import Config

In [2]: Config.objects.create(name='xx', v2_schema='xx', v2_config='xx')

填写的参数可以参考下app/migrations/0004_auto_20191207_1737.pyinit_config函数

@zhongw
Copy link
Author

zhongw commented Aug 3, 2020

谢谢了。

@zhongw zhongw closed this as completed Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants