[Product-Developers] Troubles with PostgreSQLStorage

cewing cewing at u.washington.edu
Tue Jul 15 08:35:13 UTC 2008


I've been working on creating a few content types that use PostgreSQLStorage
for many of their fields.  I've got the content types set up so they appear
correctly in portal_types, they are also listed in the archetype_tool under
'connections' and both are listed as connecting using the connection I
created to my postgre db.  

However, when I try to actually add an instance of one of these types, I get
the following traceback

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 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 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 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 745, in do_insertStructure_tal
  Module Products.PageTemplates.Expressions, line 221, in evaluateStructure
  Module zope.tales.tales, line 696, in evaluate
   - URL:
file:/Users/cewing/Documents/consulting/jen_project/buildouts/hydras.buildout/parts/plone/CMFPlone/skins/plone_templates/main_template.pt
   - Line 99, Column 18
   - Expression: <StringExpr u'plone.contentviews'>
   - Names:
      {'container': <PloneSite at /hydras>,
       'context': <LocatorTagType at
/hydras/tests/locatortagtype.2008-07-15.1013244219 used for
/hydras/tests/portal_factory/LocatorTagType>,
       'default': ,
       'here': <LocatorTagType at
/hydras/tests/locatortagtype.2008-07-15.1013244219 used for
/hydras/tests/portal_factory/LocatorTagType>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at
0x86713c8>,
       'request': <HTTPRequest,
URL=http://localhost:8080/hydras/tests/portal_factory/LocatorTagType/locatortagtype.2008-07-15.1013244219/base_view>,
       'root': <Application at >,
       'template': <FSPageTemplate at /hydras/base_view used for
/hydras/tests/locatortagtype.2008-07-15.1013244219>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>}
  Module Products.Five.browser.providerexpression, line 37, in __call__
  Module plone.app.viewletmanager.manager, line 151, in render
  Module plone.app.viewletmanager.manager, line 80, in render
  Module zope.app.pagetemplate.simpleviewclass, line 44, in __call__
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
  Module zope.tal.talinterpreter, line 271, in __call__
  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 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 586, in do_setLocal_tal
  Module zope.tales.tales, line 696, in evaluate
   - URL: index
   - Line 6, Column 4
   - Expression: <PathExpr standard:'ploneview/prepareObjectTabs'>
   - Names:
      {'container': <LocatorTagType at
/hydras/tests/locatortagtype.2008-07-15.1013244219>,
       'context': <LocatorTagType at
/hydras/tests/locatortagtype.2008-07-15.1013244219>,
       'default': ,
       'here': <LocatorTagType at
/hydras/tests/locatortagtype.2008-07-15.1013244219>,
       'loop': {},
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at
0x8664d50>,
       'request': <HTTPRequest,
URL=http://localhost:8080/hydras/tests/portal_factory/LocatorTagType/locatortagtype.2008-07-15.1013244219/base_view>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0x8697d50>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <Products.Five.viewlet.viewlet.SimpleViewletClass from
/Users/cewing/.buildout/eggs/plone.app.layout-1.1.3-py2.4.egg/plone/app/layout/viewlets/contentviews.pt
object at 0x86977f0>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper
object at 0x8697110>}
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 161, in _eval
  Module Products.PageTemplates.Expressions, line 123, in render
  Module plone.memoize.view, line 55, in memogetter
  Module Products.CMFPlone.browser.ploneview, line 252, in prepareObjectTabs
AttributeError: 'NoneType' object has no attribute 'queryMethodID'


running pdb.set_trace() inside
Products.CMFPlone.browser.ploneview.prepareObjectTabs reveals an interesting
problem, my new content object appears never to have been created, even
though the base_view of it has been requested.

Looking in prepareObjectTabs I discover the following:
request_url_path is built expecting request_url to be basically the same as
context_url,
  in my case context_url =
'http://localhost:8080/hydras/tests/locatortagtype.2008-07-15.6395824199'
             but request_url =
'http://localhost:8080/hydras/tests/portal_factory/LocatorTagType/locatortagtype.2008-07-15.6395824199/base_view'
  so instead of request_url_path coming out as '/base_view' or 'base_view',
as expected in prepareObjectTabs, it comes out as:
    'rtagtype.2008-07-15.6395824199/base_view'
  and as a result, the code at line 252 fails 

The only thing I can think is that somehow the base_edit form is being
processed but is somehow returning the factory rather than the object the
factory was supposed to create.  I wonder if anyone has run into a similar
problem, or might have any ideas on how to figure out what's going wrong.

Thanks

Cris
-- 
View this message in context: http://n2.nabble.com/Troubles-with-PostgreSQLStorage-tp528655p528655.html
Sent from the Product Developers mailing list archive at Nabble.com.





More information about the Product-Developers mailing list