Closed konr4d closed 11 years ago
On Tue, Jul 10, 2012, Konrad Adamczyk reply+i-5531608-e1d65f88ae78b9b4c8eb460f372057c580fd3034-86222@reply.github.co wrote:
I get:
Invalid template name in 'extends' tag: ''. Got this from the 'newsarticle.get_template' variable. 1 : {% extends newsarticle.get_template %}
What's happening here is that the newsarticle needs to know which base template to use, and though get_template() should always be able to work one out it obviously hasn't, somehow.
If you can get on to #arkestra on irc.freenode.net, I am sure we can pin this down quickly - it is almost certainly a minor configuration matter.
Otherwise, do try the newer pip branch, and the instructions at
https://github.com/evildmp/Arkestra/blob/pip/docs/getting_started/installation.rst
They make it much easier to get started.
Still:
https://github.com/evildmp/Arkestra/blob/pip/arkestra_utilities/generic_models.py#L67
This is get_template():
@property
def get_template(self):
return self.get_hosted_by.get_template()
Which calls:
@property
def get_hosted_by(self):
return self.hosted_by or default_entity
So it finds the Entity hosting this item, which is either the explicitly set hosted_by field for the NewsArticle, or failing that the default_entity (defined in settings).
Once it has worked out the Entity, it wants Entity.get_template().
https://github.com/evildmp/Arkestra/blob/pip/contacts_and_people/models.py#L392
def get_template(self):
"""
Returns a template for any pages that need to render based on this entity
"""
if self.get_website:
return self.get_website.get_template()
else:
return default_entity.get_website.get_template()
If the Entity has a cms.Page as its website field, then do cms.Page.get_template(); if not, return the website template of your site's default_entity.
This means that every Akrestra site must have a default_entity; in the example project it's defined here:
https://github.com/evildmp/Arkestra/blob/pip/example_14/example_14/arkestra_settings.py#L14
Can't replicate.
I get:
TemplateSyntaxError at /news/long-title/ Invalid template name in 'extends' tag: ''. Got this from the 'newsarticle.get_template' variable.
while trying to access news from the list.
Whole trace:
Request Method: GET Request URL: http://localhost:8000/news/long-title/
Django Version: 1.4 Python Version: 2.7.3 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.sitemaps', 'django.contrib.flatpages', 'south', 'cms', 'mptt', 'menus', 'sekizai', 'cms.plugins.file', 'cms.plugins.picture', 'cms.plugins.teaser', 'cms.plugins.text', 'cms.plugins.video', 'cms.plugins.twitter', 'arkestra_utilities', 'contacts_and_people', 'vacancies_and_studentships', 'news_and_events', 'links', 'arkestra_utilities.widgets.combobox', 'arkestra_image_plugin', 'video', 'housekeeping', 'polymorphic', 'semanticeditor', 'easy_thumbnails', 'typogrify', 'filer', 'widgetry', 'sieci_cms.news', 'sieci_cms.people', 'sieci_cms.projects') Installed Middleware: ('django.middleware.gzip.GZipMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', 'cms.middleware.multilingual.MultilingualURLMiddleware', 'cms.middleware.page.CurrentPageMiddleware', 'cms.middleware.user.CurrentUserMiddleware', 'cms.middleware.toolbar.ToolbarMiddleware')
Template error: In template /home/konrad/work/pjwstk/sieci_cms/libs/news_and_events/templates/news_and_events/newsarticle.html, error at line 1 Invalid template name in 'extends' tag: ''. Got this from the 'newsarticle.get_template' variable. 1 : {% extends newsarticle.get_template %} 2 : {% load arkestra_date_tags typogrify_tags humanize thumbnail placeholder_tags %} 3 : 4 : {% block title %} 5 :
Traceback: File "/home/konrad/work/pjwstk/sieci_cms/libs/django/core/handlers/base.py" in get_response
Exception Type: TemplateSyntaxError at /news/long-title/ Exception Value: Invalid template name in 'extends' tag: ''. Got this from the 'newsarticle.get_template' variable.