Fantomas42 / django-blog-zinnia

Simple yet powerful and really extendable application for managing a blog within your Django Web site.
http://django-blog-zinnia.com/
BSD 3-Clause "New" or "Revised" License
2.11k stars 731 forks source link

zinnia add new entry error,pls help me #419

Closed ambleryang closed 9 years ago

ambleryang commented 9 years ago

AttributeError at /admin/zinnia/entry/add/ 'NoneType' object has no attribute '_meta' Request Method: GET Request URL: http://127.0.0.1:8000/admin/zinnia/entry/add/ Django Version: 1.8 Exception Type: AttributeError Exception Value:
'NoneType' object has no attribute '_meta' Exception Location: /Library/Python/2.7/site-packages/Django-1.8-py2.7.egg/django/db/models/fields/related.py in get_related_field, line 1354 Python Executable: /usr/bin/python Python Version: 2.7.6 Python Path:
['/Users/yanggz/myPython/blog', '/Applications/PyCharm.app/Contents/helpers/pydev', '/Library/Python/2.7/site-packages/Scrapy-0.24.4-py2.7.egg', '/Library/Python/2.7/site-packages/six-1.8.0-py2.7.egg', '/Library/Python/2.7/site-packages/cssselect-0.9.1-py2.7.egg', '/Library/Python/2.7/site-packages/w3lib-1.10.0-py2.7.egg', '/Library/Python/2.7/site-packages/lxml-3.4.1-py2.7-macosx-10.10-intel.egg', '/Library/Python/2.7/site-packages/Django-1.8-py2.7.egg', '/Library/Python/2.7/site-packages/distribute-0.6.28-py2.7.egg', '/Library/Python/2.7/site-packages/MySQL_python-1.2.4b4-py2.7-macosx-10.10-intel.egg', '/Library/Python/2.7/site-packages/queuelib-1.2.2-py2.7.egg', '/Library/Python/2.7/site-packages/Pillow-2.7.0-py2.7-macosx-10.10-intel.egg', '/Library/Python/2.7/site-packages/Cython-0.21.2-py2.7-macosx-10.10-intel.egg', '/Library/Python/2.7/site-packages/pip-6.0.6-py2.7.egg', '/Library/Python/2.7/site-packages/django_cassandra_engine-0.2.2-py2.7.egg', '/Library/Python/2.7/site-packages/cqlengine-0.21.0-py2.7.egg', '/Library/Python/2.7/site-packages/djangotoolbox-1.6.2-py2.7.egg', '/Library/Python/2.7/site-packages/cassandra_driver-2.1.4-py2.7-macosx-10.10-intel.egg', '/Library/Python/2.7/site-packages/futures-2.2.0-py2.7.egg', '/Users/yanggz/myPython/blog', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/PIL'] Server time: 星期五, 24 四月 2015 19:48:29 +0800 Error during template rendering

In template /Library/Python/2.7/site-packages/Django-1.8-py2.7.egg/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19 'NoneType' object has no attribute '_meta' 9 {% for field in line %} 10 <div{% if not line.fields|length_is:'1' %} class="field-box{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}> 11 {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %} 12 {% if field.is_checkbox %} 13 {{ field.field }}{{ field.label_tag }} 14 {% else %} 15 {{ field.label_tag }} 16 {% if field.is_readonly %} 17

{{ field.contents }}

18 {% else %} 19

  {{ field.field }}

20 {% endif %} 21 {% endif %} 22 {% if field.field.help_text %} 23

{{ field.field.help_text|safe }}

24 {% endif %} 25
26 {% endfor %} 27
28 {% endfor %} 29

ambleryang commented 9 years ago

commenting out lines 72 and 73 in zinnia/admin/forms.py . it's ok. Is this a good solution?

Fantomas42 commented 9 years ago

For the now, the better solution is to stay in Django 1.7.

I close the issue, cause it's a duplicate of the support for Django 1.8

Regards