[Product-Developers] Re: custom at edit form?

Derek Richardson derek.richardson at gatech.edu
Tue Mar 11 17:29:38 UTC 2008


I tried following Tom's instructions and failed. Specifically, I simply 
copied base_edit.cpt to my product's skins folder and renamed it 
'servicepage_edit.pt'. I then changed the GS profile for my type to replace:

<alias from="edit" to="atct_edit" />

with:

<alias from="edit" to="servicepage_edit" />

Note that I did not make any edits to the copied and renamed template. 
When I attempt to add an object, I get (hang on!):

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.CMFPlone.FactoryTool, line 376, in __call__
   Module ZPublisher.mapply, line 88, in mapply
   Module ZPublisher.Publish, line 42, in call_object
   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.CMFCore.FSPageTemplate, line 155, in pt_render
   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 586, in do_setLocal_tal
   Module zope.tales.tales, line 696, in evaluate
    - URL: 
file:/Users/dkr/zope-insts/gatech.service/parts/plone/Archetypes/skins/archetypes/widgets/field.pt
    - Line 61, Column 4
    - Expression: <PythonExpr errors.get(fieldName)>
    - Names:
       {'container': <PloneSite at /site>,
        'context': <ServicePage at /site/portal_factory/Service 
Page/service_page.2008-03-04.4293212358 used for /site>,
        'default': <object object at 0x4c528>,
        'here': <ServicePage at /site/portal_factory/Service 
Page/service_page.2008-03-04.4293212358 used for /site>,
        'loop': {u'field': 
<Products.PageTemplates.Expressions.PathIterator object at 0x773cd50>,
                 u'fieldset': 
<Products.PageTemplates.Expressions.PathIterator object at 0x777a610>},
        'nothing': None,
        'options': {'args': ()},
        'repeat': <Products.PageTemplates.Expressions.SafeMapping object 
at 0x820a210>,
        'request': <HTTPRequest, 
URL=http://localhost:8080/site/portal_factory/Service 
Page/service_page.2008-03-04.4293212358/servicepage_edit>,
        'root': <Application at >,
        'template': <FSPageTemplate at /site/servicepage_edit used for 
/site/portal_factory/Service Page/service_page.2008-03-04.4293212358>,
        'traverse_subpath': [],
        'user': <PloneUser 'derek'>}
   Module Products.PageTemplates.ZRPythonExpr, line 49, in __call__
    - __traceback_info__: errors.get(fieldName)
   Module PythonExpr, line 1, in <expression>
   Module AccessControl.ImplPython, line 686, in guarded_getattr
AttributeError: 'NoneType' object has no attribute 'get'

Remember, the template is just the renamed and moved template from Plone 
3.0.6. Ideas?

Thanks!

Derek

Tom Lazar wrote:
> hi derek,
> 
> hth: http://tomster.org/blog/customizing-base_edit-using-widgets
> 
> cheers,
> 
> tom
> 
> On Feb 26, 2008, at 7:27 PM, Derek Richardson wrote:
> 
>> i need to write a custom AT CT edit form. I've misplaced my copy of 
>> optilude's book. :( I've looked for the edit form for the OOTB at ct 
>> and haven't turned up anything useful to me. any suggestions about 
>> where to look for examples of customized edit forms? I've written a 
>> customized view pt, but I'm unclear about how to display the widget 
>> for a particular field in a edit form pt. advice on how to do that 
>> would be on point and appreciated greatly.
>>
>> Thanks!
>>
>> Derek
>>
>>
>> _______________________________________________
>> Product-Developers mailing list
>> Product-Developers at lists.plone.org
>> http://lists.plone.org/mailman/listinfo/product-developers
>>





More information about the Product-Developers mailing list