django-blog-zinnia / cmsplugin-zinnia

Bridge between django-blog-zinnia and django-cms
BSD 3-Clause "New" or "Revised" License
53 stars 46 forks source link

TypeError Exception Value: argument of type 'NoneType' is not iterable #34

Closed macw007 closed 9 years ago

macw007 commented 9 years ago

Environment:

Request Method: GET Request URL: http://staging.thequotientgroup.com/en-us/admin/zinnia/

Django Version: 1.3.1 Python Version: 2.7.2 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.markup', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.syndication', 'django.contrib.comments', 'cumulus', 'cms', 'cms_taggit', 'mptt', 'menus', 'sekizai', 'reversion', 'cms.plugins.flash', 'cms.plugins.googlemap', 'cms.plugins.link', 'cms.plugins.snippet', 'cms.plugins.text', 'cms.plugins.twitter', 'cms.plugins.file', 'cms.plugins.picture', 'cms.plugins.teaser', 'cms.plugins.video', 'cmsplugin_contact', 'tagging', 'zinnia', 'zinnia.plugins', 'easy_thumbnails', 'articles', 'south', 'social_auth', 'residence', 'debug_toolbar'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'debug_toolbar.middleware.DebugToolbarMiddleware', 'cms.middleware.multilingual.MultilingualURLMiddleware', 'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.user.CurrentUserMiddleware', 'cms.middleware.toolbar.ToolbarMiddleware')

Template error: In template the_quotient_group/local/lib/python2.7/site-packages/zinnia/templates/admin/zinnia/widgets/content_stats.html, error at line 11 Caught AssertionError while rendering: latest() requires either a field_name parameter or 'get_latest_by' in the model 1 : {% extends "admin/zinnia/widgets/base.html" %}

2 : {% load i18n zinnia_tags %}

3 :

4 : {% block module_id %}contents{% endblock %}

5 :

6 : {% block summary %}{% trans "Today" %}{% endblock %}

7 :

8 : {% block title %}{% trans "Today" %}{% endblock %}

9 :

10 : {% block content %}

11 : {% zinnia_statistics "admin/zinnia/widgets/_content_stats.html" %}

12 : {% endblock %}

13 :

/var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/core/handlers/base.py in get_response response = response.render() ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/response.py in render self.content = self.rendered_content ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/response.py in rendered_content content = template.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render def _render(self, context): return self.nodelist.render(context) def render(self, context): "Display stage -- can be called many times" context.render_context.push() try: return self._render(context) ... finally: context.render_context.pop() def compile_string(template_string, origin): "Compiles template_string into NodeList ready for rendering" if settings.TEMPLATE_DEBUG: ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in _render return self.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render return compiled_parent._render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in _render return self.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render return compiled_parent._render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in _render return self.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render return compiled_parent._render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in _render return self.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render return compiled_parent._render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in _render return self.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render result = block.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render return self.render_template(self.template, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render_template output = template.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render return self._render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in _render return self.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render return compiled_parent._render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in _render return self.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/loader_tags.py in render result = block.nodelist.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render bit = self.render_node(node, context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/debug.py in render_node return node.render(context) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/template/base.py in render _dict = func(_resolved_args, _resolved_kwargs) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/zinnia/templatetags/zinnia_tags.py in zinnia_statistics total_words_entry += e.word_count ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/zinnia/models_bases/entry.py in word_count return len(strip_tags(self.html_content).split()) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/utils/functional.py in wrapper return func(_args, _kwargs) ... ▶ Local vars /var/www/vhosts/the_quotient_group/local/lib/python2.7/site-packages/django/utils/html.py in strip_tags if not ('<' in value or '>' in value): ... ▶ Local vars

Exception Type: TemplateSyntaxError at /admin/zinnia/ Exception Value: Caught AssertionError while rendering: latest() requires either a field_name parameter or 'get_latest_by' in the model

Fantomas42 commented 9 years ago

Django Version: 1.3.1 woooh

Which version of Zinnia do you use ?

macw007 commented 9 years ago

so sorry i upgraded to django 1.6.5

macw007 commented 9 years ago

cmsplugin-zinnia 0.6 django-blog-zinnia 0.14.2

Fantomas42 commented 9 years ago

The word_count property on the entries seems to fail when stripping the HTML tags. Can I have a dump of your entries, to see what can cause this issue ? Or a sample of the content from the entries which cause the issue.

macw007 commented 9 years ago

I do not know what i did but i fixed it after flushing my database then uninstall and reinstall django-blog-zinnia and cmsplugin-zinnia before syncing my database or migrating seem to have worked, or atleast thats what i did

Fantomas42 commented 9 years ago

So maybe you can close the issue ?