News and events templatetags #73

darbula opened this Issue Mar 22, 2013 · 5 comments


None yet

2 participants

darbula commented Mar 22, 2013

News and events template tags are not working. There are few issues. First one is that work_out_entity on this line cannot be imported it should be uncommented and with full path:

from contacts_and_people.templatetags.entity_tags import work_out_entity

Another problem is on the next import CMSNewsAndEventsPlugin and this is the relevant (last) part of the traceback:

File "...env\src\arkestra\news_and_events\templatetags\", line 4, in <module>
 from news_and_events.cms_plugins import CMSNewsAndEventsPlugin
File "...env\src\arkestra\news_and_events\", line 9, in <module>
 from arkestra_utilities.admin_mixins import AutocompleteMixin
File "...env\src\arkestra\arkestra_utilities\", line 8, in <module>
  from widgetry.tabs.placeholderadmin import ModelAdminWithTabsAndCMSPlaceholder
File "...env\src\django-widgetry\widgetry\tabs\", line 2, in <module>
 from cms.admin.placeholderadmin import PlaceholderAdmin
File "...env\lib\site-packages\cms\admin\", line 2, in <module>
 import pageadmin
File "...env\lib\site-packages\cms\admin\", line 1468, in <module>
File "...env\lib\site-packages\cms\admin\", line 98, in contribute_fieldsets
 if menu_pool.get_menus_by_attribute("cms_enabled", True):
File "...env\lib\site-packages\menus\", line 183, in get_menus_by_attribute
File "...env\lib\site-packages\menus\", line 74, in discover_menus
File "...env\lib\site-packages\cms\utils\", line 42, in load
 get_module(app, modname, verbose, failfast)
File "...env\lib\site-packages\cms\utils\", line 21, in get_module
 module = import_module(module_name)
File "...env\lib\site-packages\django\utils\", line 35, in import_module
File "...env\src\arkestra\arkestra_utilities\", line 26, in <module>
 menu["cms_plugin_model"] = getattr(plugin, menu["cms_plugin_model_name"])
AttributeError: 'module' object has no attribute 'CMSNewsAndEventsPlugin'

It seems that the name CMSNewsAndEventsPlugin from the module ...env\src\arkestra\news_and_events\ is needed while the same module is still importing its dependencies (line 9).

evildmp commented Mar 22, 2013

Are you trying to use {% news_and_events %}? That's the only thing there that's interested in work_out_entity. And unless you really, really want to use {% news_and_events %}, my suggestion would be to get rid of the news_and_events() inclusion tag altogether.

It's not used anywhere in Arkestra itself, any more. Do you have a template that needs to use the tag?

darbula commented Mar 22, 2013

Yes I'm using {% news_and_events %} the other approach is to use plugin but I like tag better. For now I solved work_out_entity by uncommenting import line and giving the full path, that is from contacts_and_people.templatetags.entity_tags import work_out_entity.

Second, circular dependency issue is avoided by importing CMSNewsAndEventsPlugin inside inclusion tags.

evildmp commented Mar 22, 2013

If you really have a use for it, I guess {% news_and_events %} is worth keeping.

darbula commented Mar 22, 2013

What is the alternative, except for using plugin in placeholder?

evildmp commented Mar 23, 2013

There is no alternative.

Be warned however that the code in is out of date.

For example, the current_or_archive attribute has been replaced with view, and takes different slightly values.

There's some explanation at, but I really need to do some work on all this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment