I am getting the following message. "TemplateSyntaxError at /admin/zinnia/ - Caught AssertionError while rendering: latest() requires either a field_name parameter or 'get_latest_by' in the model" Here is the Traceback: http://pastebin.com/2EqzPb84 I have installed Zinnia using "pip install -e git:/...", which means I have version 0.10. I get this error when I visit /en/admin/zinnia/. I tried executing "Entry.published.latest()" in the django shell and I get the same message.
I have tried to reproduce the bug, but I cannot.
Even if I do a Entry.published.latest() in the django shell.
The traceback seems to say that the get_latest_by attribute is not defined, but the Entry's Meta class define the get_latest_by attribute to creation_date.
Have you done a extension of the Entry model ?
I am not sure what is wrong with my installation. I have not extended the Entry model. I deleted all my posts and disabled my own cms plugins to make sure my stuff wasn't inadvertently causing some kind of mysterious interference. I then made some entries, saved them as drafts, visited /admin/zinnia/ and did not get any errors. When I changed one of these entries to published and visited /admin/zinnia/ I got the error.
I think I managed to fix it, though. I added the following function to class EntryPublishedManager in zinnia/managers.py and the error is gone.
What is your version of Django ?
I have Django 1.3.1
I don't understand why the manager cannot find this standard method...
Any possibility to provide me an ssh access to take a look with my own eyes on this really strange issue?
I'm asking this because I can't reproduce locally the problem.
I can't really give SSH access (or I am too lazy to figure it out). It's inside a server inside a virtual box instance on my local machine. I don't know why it's doing that either. I re-installed zinnia (using the same django module) and it's doing it again. Perhaps it is just me and I screwed something up, but it is only a minor inconvenience as I don't really go to that page anyway. Please don't trouble yourself with it. Thank you for the help, though.
Ok I understand that you cannot give an ssh access, no problems.
So I will close the issue until further information.
I' just got the same issue. This is vanilla & django-cms installation.
^Croot@li394-186:/opt/infinigon/lambdafx# pip freeze
Warning: cannot find svn location for distribute==0.6.16dev-r0
This issue is affecting me as well; I do not know what it is about our setups that are causing it, but I do know that, in the zinnia_statistics() tag in zinnia/templatetags/zinnia_tags.py, the 'first_entry' and 'last_entry' variables seem to be Entry instances, their Meta attributes are objects of type cmsplugin_zinnia.placeholder.Meta, which does not inherit from Entry.
Is there any reason for EntryPlaceholder.Meta to not inherit EntryAbstractClass.Meta? Currently it does not, and adding it made everything work for me.
thank you wmsmith for your explanation, everything seems logic now.
It's a known bug of the EntryPlaceholderModel since Zinnia extends the Meta class of the Entry model.
The good news is that the bug is already fixed in django-blog-zinnia/cmsplugin-zinnia@63a3fc5 but you have to use cmsplugin_zinnia instead of zinnia.plugins because the module has been removed in the latest versions of Zinnia.
Ahh...didn't know it was a known bug...sorry.
I am using cmsplugin_zinnia, but I had not updated to the latest master of cmsplugin_zinnia...any chance of a new release on pypi? It currently has 0.1, but that version does not have the patch.
Thanks for your prompt reply!
@wmsmith you are right the 0.1 version does not have the patch...
But the release 0.2 for cmsplugin_zinnia is planned in few days.
Sounds great; thanks!
The version 0.2 is now released on Pypi.
It takes me less time than I expected.
Nice! Editing my pip requirements file now....