DataGridField causes AttributeError: 'zope.i18nmessageid.message.Message' object has no attribute 'getMacro'

2 messages Options
Embed this post
Permalink
ajung () DataGridField causes AttributeError: 'zope.i18nmessageid.message.Message' object has no attribute 'getMacro'
Reply Threaded More More options
Print post
Permalink
I have a simple AT content-type with the following two extra fields:
 24 schema = Schema(($
 25     DataGridField($
 26         name='info',$
 27         searchable=True,$
 28         allow_empty_rows=True,$
 29         columns=('start','end','content'),$
 30         widget=DataGridWidget($
 31             label=_(u'idg_org_label_info',),$
 32             description=_(u'idg_org_help_info'),$
 33             columns = {$
 34                     'start': Column(_(u'idg_org_label_from')),$
 35                     'end': Column(_(u'idg_org_label_end')),$
 36                     'content': Column(_(u'idg_org_label_content')),$
 37                 },$
 38         ),$
 39     ),$
 40     DataGridField($
 41         name='education',$
 42         searchable=True,$
 43         allow_empty_rows=True,$
 44         columns=('start','end','content'),$
 45         widget=DataGridWidget($
 46             label=_(u'idg_org_label_education',),$
 47             description=_(u'idg_org_help_education'),$
 48             columns = {$
 49                     'start': Column(_(u'idg_org_label_from')),$
 50                     'end': Column(_(u'idg_org_label_end')),$
 51                     'content': (_(u'idg_org_label_content')),$
 52                 },$
 53         ),$
 54     ),$
 55 ))$


causing the following traceback....

> /home/plone/.buildout/eggs/Products.DataGridField-1.6.1-py2.4.egg/Products/DataGridField/DataGridWidget.py(118)getColumnDefs()
-> result.append(item)                                                                                                          
(Pdb) c                                                                                                                        
2009-11-02 10:04:56 ERROR Zope.SiteErrorLog http://diaweb07:11109/idg/web/einrichtungen/berlin-wannsee/mitarbeiter-berlin-wannsee/vita-heinz-becker/base_edit
Traceback (innermost last):                                                                                                                                  
  Module ZPublisher.Publish, line 119, in publish                                                                                                            
  Module ZPublisher.mapply, line 88, in mapply                                                                                                              
  Module ZPublisher.Publish, line 42, in call_object                                                                                                        
  Module Products.CMFFormController.FSControllerPageTemplate, line 90, in __call__                                                                          
  Module Products.CMFFormController.BaseControllerPageTemplate, line 31, in _call                                                                            
  Module Shared.DC.Scripts.Bindings, line 313, in __call__                                                                                                  
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec                                                                                              
  Module Products.CMFCore.FSPageTemplate, line 216, in _exec                                                                                                
  Module Products.CacheSetup.patch_cmf, line 29, in FSPT_pt_render                                                                                          
  Module Products.CacheSetup.patch_utils, line 9, in call_pattern                                                                                            
  Module Products.CMFCore.FSPageTemplate, line 155, in pt_render                                                                                            
  Module Products.CacheSetup.patch_cmf, line 77, in PT_pt_render                                                                                            
  Module Products.CacheSetup.patch_utils, line 9, in call_pattern                                                                                            
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render                                                                                          
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render                                                                                              
   - Warning: Macro expansion failed                                                                                                                        
   - Warning: exceptions.KeyError: 'macro'                                                                                                                  
  Module zope.tal.talinterpreter, line 271, in __call__                                                                                                      
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 861, in do_defineMacro                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 891, in do_useMacro                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 957, in do_defineSlot                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 861, in do_defineMacro                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 957, in do_defineSlot                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 534, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 949, in do_defineSlot                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 861, in do_defineMacro                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 891, in do_useMacro                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 891, in do_useMacro                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 855, in do_condition                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 949, in do_defineSlot                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 957, in do_defineSlot                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 855, in do_condition                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 824, in do_loop_tal                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 525, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 824, in do_loop_tal                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 891, in do_useMacro                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 891, in do_useMacro                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 855, in do_condition                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 855, in do_condition                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 949, in do_defineSlot                                                                                                
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 824, in do_loop_tal                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 891, in do_useMacro                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 855, in do_condition                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 824, in do_loop_tal                                                                                                  
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal                                                                                                
  Module zope.tal.talinterpreter, line 521, in do_optTag                                                                                                    
  Module zope.tal.talinterpreter, line 516, in no_tag                                                                                                        
  Module zope.tal.talinterpreter, line 346, in interpret                                                                                                    
  Module zope.tal.talinterpreter, line 586, in do_setLocal_tal                                                                                              
  Module zope.tales.tales, line 696, in evaluate                                                                                                            
   - URL: file:/home/plone/.buildout/eggs/Products.DataGridField-1.6.1-py2.4.egg/Products/DataGridField/skins/DataGridWidget/datagridwidget_edit_row.pt      
   - Line 31, Column 15                                                                                                                                      
   - Expression: <PythonExpr path('here/%s/macros' % column_definition.getMacro())>                                                                          
   - Names:
      {'container': <PloneSite at /idg/web>,
       'context': <Vita at /idg/web/einrichtungen/berlin-wannsee/mitarbeiter-berlin-wannsee/vita-heinz-becker>,
       'default': ,
       'here': <Vita at /idg/web/einrichtungen/berlin-wannsee/mitarbeiter-berlin-wannsee/vita-heinz-becker>,
       'loop': {u'columnd': <Products.PageTemplates.Expressions.PathIterator object at 0xf31b68c>,
                u'field': <Products.PageTemplates.Expressions.PathIterator object at 0xf189c8c>,
                u'fieldset': <Products.PageTemplates.Expressions.PathIterator object at 0xf189b6c>,
                u'rows': <Products.PageTemplates.Expressions.PathIterator object at 0xf2b678c>},
       'nothing': None,
       'options': {'args': (),
                   'state': <Products.CMFFormController.ControllerState.ControllerState object at 0xe759fac>},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xe76d3ec>,
       'request': <HTTPRequest, URL=http://diaweb07:11109/idg/web/einrichtungen/berlin-wannsee/mitarbeiter-berlin-wannsee/vita-heinz-becker/base_edit>,
       'root': <Application at >,
       'template': <FSControllerPageTemplate at /idg/web/base_edit used for /idg/web/einrichtungen/berlin-wannsee/mitarbeiter-berlin-wannsee/vita-heinz-becker>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'ajung'>}
  Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
   - __traceback_info__: path('here/%s/macros' % column_definition.getMacro())
  Module PythonExpr, line 1, in <expression>
  Module AccessControl.ImplPython, line 686, in guarded_getattr
AttributeError: 'zope.i18nmessageid.message.Message' object has no attribute 'getMacro'


Any idea?

Plone 3.1.7, DataGridField 1.6.1.

Andreas
Maurits van Rees-3 () Re: DataGridField causes AttributeError: 'zope.i18nmessageid.message.Message' object has no attribute 'getMacro'
Reply Threaded More More options
Print post
Permalink
ajung, on 2009-11-02:
>
> I have a simple AT content-type with the following two extra fields:
...
>  48             columns = {$
>  49                     'start': Column(_(u'idg_org_label_from')),$
>  50                     'end': Column(_(u'idg_org_label_end')),$
>  51                     'content': (_(u'idg_org_label_content')),$

That last line should also be a Column:

>  51                     'content': Column(_(u'idg_org_label_content')),$

Cheers,

--
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Plone-Users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-users