[Z3-sqlos] add and sqlmeta errors

Stéphane Brault stephane_brault at yahoo.fr
Thu Mar 30 17:03:11 CEST 2006


Hi,
I'm using sqlos for a zope 3 project using an existing
mysql database. Following the tutorial, I was able to
create a table object as well as a container. I also
had to add a sqlmeta class. Everything works fine
except : 
- when I try to add an object, I get the following
error : Traceback (innermost last):
  Module zope.publisher.publish, line 138, in publish
    result = publication.callObject(request, object)
  Module zope.app.publication.zopepublication, line
161, in callObject
    return mapply(ob,
request.getPositionalArguments(), request)
  Module zope.publisher.publish, line 113, in mapply
    return debug_call(object, args)
   - __traceback_info__: <security proxied
zope.app.pagetemplate.simpleviewclass.SimpleViewClass
from add.pt instance at 0x0313E170>
  Module zope.publisher.publish, line 119, in
debug_call
    return object(*args)
  Module zope.app.pagetemplate.simpleviewclass, line
44, in __call__
    return self.index(*args, **kw)
  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 277, in
__call__
    self.interpret(self.program)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 908, in
do_useMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 538, in
do_optTag_tal
    self.do_optTag(stuff)
  Module zope.tal.talinterpreter, line 523, in
do_optTag
    return self.no_tag(start, program)
  Module zope.tal.talinterpreter, line 518, in no_tag
    self.interpret(program)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 878, in
do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 976, in
do_defineSlot
    self.interpret(block)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 966, in
do_defineSlot
    self.interpret(slot)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 878, in
do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 878, in
do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 588, in
do_setLocal_tal
    self.engine.setLocal(name,
self.engine.evaluateValue(expr))
  Module zope.tales.tales, line 696, in evaluate
    return expression(self)
   -
C:\Python24\Lib\site-packages\zope\app\form\browser\add.pt
   - Line 19, Column 8
   - Expression: <PathExpr standard:u'view/update'>
   - Names:
      {'args': (),
       'context':
<zope.app.publisher.browser.viewmeta.+ object at
0x0313E4B0>,
       'default': <object object at 0x00AAC540>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': {},
       'request':
<zope.publisher.browser.BrowserRequest instance
URL=http://localhost:8080/neteven/test/+/AddCategory.html%3D>,
       'template':
<zope.app.pagetemplate.viewpagetemplatefile.ViewPageTemplateFile
object at 0x02EDDA70>,
       'usage':
<zope.pagetemplate.pagetemplate.TemplateUsage object
at 0x0313E6B0>,
       'view':
<zope.app.pagetemplate.simpleviewclass.SimpleViewClass
from add.pt object at 0x0313E170>,
       'views':
<zope.app.pagetemplate.viewpagetemplatefile.ViewMapper
object at 0x0313E050>}
  Module zope.tales.expressions, line 205, in __call__
    return self._eval(econtext)
  Module zope.tales.expressions, line 199, in _eval
    return ob()
  Module zope.app.form.browser.add, line 62, in update
    self.createAndAdd(data)
  Module zope.app.form.browser.add, line 93, in
createAndAdd
    content = self.create(*args, **kw)
  Module zope.app.form.browser.add, line 74, in create
    return self._factory(*args, **kw)
  Module sqlobject.main, line 1183, in __init__
    self._create(id, **kw)
  Module sqlobject.main, line 1202, in _create
    raise TypeError, "%s() did not get expected
keyword argument %s" % (self.__class__.__name__,
column.name)
TypeError: Categories() did not get expected keyword
argument CategoryID
I must say that the CategoryID is in the form and is
declared in the class.
- When I copy paste an object, I get :
Module zope.publisher.publish, line 138, in publish
    result = publication.callObject(request, object)
  Module zope.app.publication.zopepublication, line
161, in callObject
    return mapply(ob,
request.getPositionalArguments(), request)
  Module zope.publisher.publish, line 113, in mapply
    return debug_call(object, args)
   - __traceback_info__: <BoundPageTemplateFile of
<zope.app.publisher.browser.viewmeta.Contents object
at 0x037A8D70>>
  Module zope.publisher.publish, line 119, in
debug_call
    return object(*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 277, in
__call__
    self.interpret(self.program)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 908, in
do_useMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 538, in
do_optTag_tal
    self.do_optTag(stuff)
  Module zope.tal.talinterpreter, line 523, in
do_optTag
    return self.no_tag(start, program)
  Module zope.tal.talinterpreter, line 518, in no_tag
    self.interpret(program)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 878, in
do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 976, in
do_defineSlot
    self.interpret(block)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 966, in
do_defineSlot
    self.interpret(slot)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 878, in
do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 352, in
interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 588, in
do_setLocal_tal
    self.engine.setLocal(name,
self.engine.evaluateValue(expr))
  Module zope.tales.tales, line 696, in evaluate
    return expression(self)
   -
C:\Python24\Lib\site-packages\zope\app\container\browser\contents.pt
   - Line 7, Column 4
   - Expression: <PathExpr
standard:u'view/listContentInfo'>
   - Names:
      {'args': (),
       'context': <neteven.app.CategoriesContainer
object at 0x036E7230>,
       'default': <object object at 0x00AAC540>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': {},
       'request':
<zope.publisher.browser.BrowserRequest instance
URL=http://localhost:8080/neteven/test/@@contents.html>,
       'template':
<zope.app.pagetemplate.viewpagetemplatefile.ViewPageTemplateFile
object at 0x01C108B0>,
       'usage':
<zope.pagetemplate.pagetemplate.TemplateUsage object
at 0x037A8CD0>,
       'view':
<zope.app.publisher.browser.viewmeta.Contents object
at 0x037A8D70>,
       'views':
<zope.app.pagetemplate.viewpagetemplatefile.ViewMapper
object at 0x037BA350>}
  Module zope.tales.expressions, line 205, in __call__
    return self._eval(econtext)
  Module zope.tales.expressions, line 199, in _eval
    return ob()
  Module zope.app.container.browser.contents, line 92,
in listContentInfo
    self.pasteObjects()
  Module zope.app.container.browser.contents, line
389, in pasteObjects
    copier.copyTo(target)
  Module zope.app.copypastemove, line 408, in copyTo
    copy = locationCopy(obj)
  Module zope.app.location.pickling, line 76, in
locationCopy
    pickler.dump(loc)
PicklingError: Can't pickle <class
'sqlobject.declarative.sqlmeta'>: attribute lookup
sqlobject.declarative.sqlmeta failed.

Any hint ?

Thanks,

Stéphane


	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com



More information about the z3-sqlos mailing list