Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8986213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:29:50+00:00 2026-06-15T21:29:50+00:00

I was trying to render a list of objects into a plone template, I

  • 0

I was trying to render a list of objects into a plone template,
I wrote the python script with the query to get a list of objects, then it returns a list with the objects.

lista-fixos = context.portal_catalog.searchResults(
        Subject = { "query": ["Destaques", "Destaques-fixo"],
                     "operator": "and" 
                     }
)
lista-normal = context.portal_catalog.searchResults(
        Subject = { "query": ["Destaques"]}

)

lista-fixos.append(lista-normal)

for e in lista-fixos:
       if e not in lista-final:
           lista-final.append(e)
return lista-fixos

And here I try to get then

tal:define="results here/getCatalogDestaques.py"

Here is the script and the template
http://pastie.org/5530478

My problem is that everytime that I try to call the template it give me the following error:

Traceback (innermost last):
  Module ZPublisher.Publish, line 126, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 46, in call_object
  Module Shared.DC.Scripts.Bindings, line 322, in __call__
  Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
  Module Products.CMFCore.FSPageTemplate, line 240, in _exec
  Module Products.CMFCore.FSPageTemplate, line 180, in pt_render
  Module Products.PageTemplates.PageTemplate, line 79, in pt_render
  Module zope.pagetemplate.pagetemplate, line 113, in pt_render
   - Warning: Macro expansion failed
   - Warning: <type 'exceptions.AttributeError'>: header
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 858, in do_defineMacro
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 851, in do_condition
  Module Products.PageTemplates.Expressions, line 205, in evaluateBoolean
  Module zope.tales.tales, line 696, in evaluate
   - URL: file:/media/New Volume/ambiente_nportal/ploneAmbiente/eggs/Products.CMFContentPanels-2.6b2-py2.7.egg/Products/CMFContentPanels/skins/contentpanels/cp_new_panel_form.pt
   - Line 160, Column 7
   - Expression: <PythonExpr usemacro and exists(viewletConfPath)>
   - Names:
      {'container': <PloneSite at /Plone>,
       'context': <ATTopic at /Plone/destaques/destaques-portal>,
       'default': <object object at 0xb73016b0>,
       'here': <ATTopic at /Plone/destaques/destaques-portal>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xce95c84>,
       'request': <HTTPRequest, URL=http://localhost:8080/Plone/destaques/destaques-portal/cp_new_panel_form>,
       'root': <Application at >,
       'template': <FSPageTemplate at /Plone/cp_new_panel_form used for /Plone/destaques/destaques-portal>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>}
  Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
   - __traceback_info__: usemacro and exists(viewletConfPath)
  Module PythonExpr, line 1, in <expression>
  Module zope.tales.pythonexpr, line 77, in __call__
  Module zope.tales.expressions, line 216, in __call__
  Module Products.PageTemplates.Expressions, line 162, in _exists
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 74, in boboAwareZopeTraverse
  Module OFS.Traversable, line 315, in restrictedTraverse
  Module OFS.Traversable, line 248, in unrestrictedTraverse
   - __traceback_info__: ([], 'macros')
  Module Products.PageTemplates.PageTemplate, line 51, in macros
  Module Products.CMFCore.FSPageTemplate, line 168, in pt_macros
  Module Products.PageTemplates.PageTemplate, line 60, in pt_macros
   - Warning: Compilation failed
   - Warning: zope.tal.taldefs.TALError: Invalid variable name "here.getCatalogDestaques" in expression u'here.getCatalogDestaques', at line 7, column 1
PTRuntimeError: Page Template template-destaques has errors: ['Compilation failed', 'zope.tal.taldefs.TALError: Invalid variable name "here.getCatalogDestaques" in expression u\'here.getCatalogDestaques\', at line 7, column 1']
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:29:51+00:00Added an answer on June 15, 2026 at 9:29 pm

    Try removing the .py part from the call. ie:

    tal:define="results here/getCatalogDestaques"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get a list of objects to render on a Spring 3
I am trying to create a custom context processor which will render a list
Im trying to render a django template from a database outside of djangos normal
I am trying to use Telerik's RadPanelBar to display a list of objects. I
I am trying to parse json object to populate it into list view,but i
Given a series of objects, I am trying to split them up into a
I'm trying to load a distinct list of values into a ModelChoiceField . class
I'm working with Steve Sanderson's BeginCollectionItem utility to render a list of objects to
I'm new to django and I'm trying to get display a list of buildings
i'm trying to deserialize a json string into a new list on C# using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.