[Z3-sqlos] sqlos and mysqldbda

Sam Young samuel.j.young at gmail.com
Mon Feb 19 07:38:33 CET 2007


Hi,

New to the list, but I'm having a little bit of trouble with sqlos and
mysqldbda. My SQLObject subclass is working perfectly with MySQLdb,
and entering queries for mysqldbda manually through ZMI works just
fine. At one point, I had the sqlos-0.3.0 sampleapp running on a fresh
Zope-3.3.1 instance.

Now, when I try to integrate my app (simple object, simple container)
I'm getting the following after adding a new container in ZMI. When I
try to get the sampleapp working again, I get a similar error during
table creation. If I'm not mistaken, the check for need_unicode is
part of SQLObject. The "self" in self.need_unicode is seemingly being
called on MySQLAdapter in sqlos, causing the error.

Has anyone seen this before? I'm glad to provide more information from
configuration or the classes themselves.

I hear PostgreSQL is easier to integrate with sqlos, but I'm not sure
that will be an option in my case.


Thank you kindly in advance,
Sam



Traceback (most recent call last):
  Module zope.publisher.publish, line 133, in publish
    result = publication.callObject(request, obj)
  Module zope.app.publication.zopepublication, line 161, in callObject
    return mapply(ob, request.getPositionalArguments(), request)
  Module zope.publisher.publish, line 108, in mapply
    return debug_call(obj, args)
   - __traceback_info__: <BoundPageTemplateFile of
<zope.app.publisher.browser.viewmeta.Contents object at 0xb4d1f88c>>
  Module zope.publisher.publish, line 114, in debug_call
    return obj(*args)
  Module zope.app.pagetemplate.viewpagetemplatefile, line 83, in __call__
    return self.im_func(im_self, *args, **kw)
  Module zope.app.pagetemplate.viewpagetemplatefile, line 51, in __call__
    sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
    strictinsert=0, sourceAnnotations=sourceAnnotations)()
  Module zope.tal.talinterpreter, line 271, in __call__
    self.interpret(self.program)
  Module zope.tal.talinterpreter, line 346, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 891, in do_useMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 346, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 536, in do_optTag_tal
    self.do_optTag(stuff)
  Module zope.tal.talinterpreter, line 521, in do_optTag
    return self.no_tag(start, program)
  Module zope.tal.talinterpreter, line 516, in no_tag
    self.interpret(program)
  Module zope.tal.talinterpreter, line 346, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 346, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 957, in do_defineSlot
    self.interpret(block)
  Module zope.tal.talinterpreter, line 346, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 949, in do_defineSlot
    self.interpret(slot)
  Module zope.tal.talinterpreter, line 346, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 861, in do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 346, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 586, in do_setLocal_tal
    self.engine.setLocal(name, self.engine.evaluateValue(expr))
  Module zope.tales.tales, line 696, in evaluate
    return expression(self)
   - /home/sam/Zope-3.3.1/src/zope/app/container/browser/contents.pt
   - Line 7, Column 4
   - Expression: <PathExpr standard:u'view/listContentInfo'>
   - Names:
      {'args': (),
       'context': <zope.app.folder.folder.Folder object at 0xb625c56c>,
       'default': <object object at 0xb7d95560>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': {},
       'request': <zope.publisher.browser.BrowserRequest instance
URL=http://samscape:8080/tt/@@contents.html>,
       'template':
<zope.app.pagetemplate.viewpagetemplatefile.ViewPageTemplateFile
object at 0xb6f1b18c>,
       'usage': <zope.pagetemplate.pagetemplate.TemplateUsage object
at 0xb4d1f98c>,
       'view': <zope.app.publisher.browser.viewmeta.Contents object at
0xb4d1f88c>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper
object at 0xb4d1fbcc>}
  Module zope.tales.expressions, line 217, in __call__
    return self._eval(econtext)
  Module zope.tales.expressions, line 211, in _eval
    return ob()
  Module zope.app.container.browser.contents, line 80, in listContentInfo
    self.addObject()
  Module zope.app.container.browser.contents, line 245, in addObject
    adding.action(request['type_name'], new)
  Module zope.app.container.browser.adding, line 152, in action
    self.add(content)
  Module zope.app.container.browser.adding, line 72, in add
    container[name] = content
  Module zope.app.folder.folder, line 94, in __setitem__
    setitem(self, self.data.__setitem__, name, object)
  Module zope.app.container.contained, line 593, in setitem
    notify(event)
  Module zope.event, line 23, in notify
    subscriber(event)
  Module zope.component.event, line 26, in dispatch
    for ignored in zope.component.subscribers(event, None):
  Module zope.component._api, line 130, in subscribers
  Module zope.component.registry, line 290, in subscribers
  Module zope.interface.adapter, line 535, in subscribers
    subscription(*objects)
  Module zope.component.event, line 33, in objectEventNotify
    adapters = zope.component.subscribers((event.object, event), None)
  Module zope.component._api, line 130, in subscribers
  Module zope.component.registry, line 290, in subscribers
  Module zope.interface.adapter, line 535, in subscribers
    subscription(*objects)
  Module zope.app.container.contained, line 181, in dispatchToSublocations
    for sub in subs.sublocations():
  Module zope.app.container.contained, line 212, in sublocations
    for key in container:
  Module sqlos.container, line 103, in keys
    for name, obj in self.items(): yield name
  Module sqlos.container, line 119, in items
    for obj in utility.select():
  Module sqlobject.sresults, line 155, in __iter__
    return iter(list(self.lazyIter()))
  Module sqlobject.sresults, line 163, in lazyIter
    return conn.iterSelect(self)
  Module sqlobject.dbconnection, line 365, in iterSelect
    select, keepConnection=False)
  Module sqlobject.dbconnection, line 706, in __init__
    self.dbconn._executeRetry(self.rawconn, self.cursor, self.query)
  Module sqlos.adapter, line 124, in _executeRetry
    raise DatabaseException(str(exc.args))
DatabaseException: ("'MySQLAdapter' object has no attribute 'need_unicode'",)


More information about the z3-sqlos mailing list