sshwsfc / xadmin

Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty UI based on Twitter Bootstrap.
http://www.xadmin.io
BSD 3-Clause "New" or "Revised" License
4.76k stars 1.41k forks source link

render() got an unexpected keyword argument 'template_pack',这个问题怎么解决啊 #301

Open solonext-shi opened 8 years ago

solonext-shi commented 8 years ago

TypeError at /app/host/add/ render() got an unexpected keyword argument 'template_pack' Request Method: GET Request URL: http://127.0.0.1:8000/app/host/add/ Django Version: 1.7.11 Exception Type: TypeError Exception Value:
render() got an unexpected keyword argument 'template_pack' Exception Location: C:\Python27\lib\site-packages\django_crispy_forms-1.6.0-py2.7.egg\crispy_forms\utils.py in render_field, line 73 Python Executable: C:\Python27\python.exe Python Version: 2.7.11 Python Path:
['C:\Users\Jake\Desktop\django-xadmin-master\demo_app..', 'C:\Users\Jake\Desktop\django-xadmin-master\demo_app', 'C:\Python27\lib\site-packages\django-1.7.11-py2.7.egg', 'C:\Python27\lib\site-packages\django_xadmin-0.5.0-py2.7.egg', 'C:\Python27\lib\site-packages\django_crispy_forms-1.6.0-py2.7.egg', 'C:\Python27\lib\site-packages\django_reversion-1.10.1-py2.7.egg', 'C:\Python27\lib\site-packages\httplib2-0.9.2-py2.7.egg', 'C:\WINDOWS\SYSTEM32\python27.zip', 'C:\Python27\DLLs', 'C:\Python27\lib', 'C:\Python27\lib\plat-win', 'C:\Python27\lib\lib-tk', 'C:\Python27', 'C:\Python27\lib\site-packages', 'c:\python27\lib\site-packages'] Server time: Tue, 5 Apr 2016 08:41:43 +0800

frmdstryr commented 8 years ago

You need to add the kwarg template_pack in the render methods https://github.com/sshwsfc/django-xadmin/search?utf8=%E2%9C%93&q=+def+render%28self%2C+form%2C+form_style%2C+context%29%3A&type=Code

solonext-shi commented 8 years ago

this methods has add,the others funtion normal operation, Only Add Host has this problem

bugkiwi commented 8 years ago

I think the best solution is to use django_crispy_forms-1.4.0, not 1.6.0; I have try fix this problem on my fork,but it only support django 1.9 and not been test all

glasslion commented 8 years ago

可以参考 #282, 和 #306, 修改 Field.render(), 添加 template_pack 参数. 或者 添加**kwargs