[Zope3-Users] object has no attribute '_SampleContainer__data'

Leticia Larrosa leticia at tesla.cujae.edu.cu
Mon Oct 3 21:29:45 EDT 2005


I'm sorry, I forgot to say that: "ServiceList" and "Service" are
hypothetical kinds of objects.

-----Original Message-----
From: zope3-users-bounces at zope.org [mailto:zope3-users-bounces at zope.org] On
Behalf Of leticia
Sent: Monday, October 03, 2005 1:11 PM
To: zope3-users at zope.org
Subject: [Zope3-Users] object has no attribute '_SampleContainer__data'

Hi:

I have an object "ServiceList" who inherit from "BTreeContainer" and
implements "IContainer" that have inside objects of type "Service" who
inherit from "BTreeContainer" too and implements "IContained" and
"IContainer".

When a try to see the view of list of "Service" of one of the "ServiceList"
I get the following error:

"""
'Service' object has no attribute '_SampleContainer__data'
"""

And the Traceback is:
"""
Traceback (innermost last):
  Module zope.publisher.publish, line 138, in publish
    result = publication.callObject(request, object)
  Module zope.app.publication.zopepublication, line 164, 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 0x03A34530>>
  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 239, in __call__
    self.interpret(self.program)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 869, in do_useMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 502, in do_optTag_tal
    self.do_optTag(stuff)
  Module zope.tal.talinterpreter, line 487, in do_optTag
    return self.no_tag(start, program)
  Module zope.tal.talinterpreter, line 482, in no_tag
    self.interpret(program)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 839, in do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 941, in do_defineSlot
    self.interpret(block)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 931, in do_defineSlot
    self.interpret(slot)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 839, in do_defineMacro
    self.interpret(macro)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 808, in do_loop_tal
    self.interpret(block)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 502, in do_optTag_tal
    self.do_optTag(stuff)
  Module zope.tal.talinterpreter, line 487, in do_optTag
    return self.no_tag(start, program)
  Module zope.tal.talinterpreter, line 482, in no_tag
    self.interpret(program)
  Module zope.tal.talinterpreter, line 314, in interpret
    handlers[opcode](self, args)
  Module zope.tal.talinterpreter, line 617, in do_insertI18nText_tal
    text = self.engine.evaluateText(stuff[0])
  Module zope.app.pagetemplate.engine, line 101, in evaluateText
    text = self.evaluate(expr)
  Module zope.tales.tales, line 698, in evaluate
    return expression(self)
   - C:\Python24\Lib\site-packages\zope\app\container\browser\contents.pt
   - Line 110, Column 16
   - Expression: <PathExpr standard:'item/size/sizeForDisplay|nothing'>
   - Names:
      {'args': (),
       'context': <srcs.configuration.ServiceList object at 0x0221E770>,
       'default': <object object at 0x0097C500>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': {},
       'request': <zope.publisher.browser.BrowserRequest instance
URL=http://localhost:8080/services/@@contents.html>,
       'template':
<zope.app.pagetemplate.viewpagetemplatefile.ViewPageTemplateFile object at
0x016679B0>,
       'usage': <zope.pagetemplate.pagetemplate.TemplateUsage object at
0x03A347D0>,
       'view': <zope.app.publisher.browser.viewmeta.Contents object at
0x03A34530>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper
object at 0x0242E090>}
  Module zope.tales.expressions, line 204, in __call__
    return self._eval(econtext)
  Module zope.tales.expressions, line 198, in _eval
    return ob()
  Module zope.app.container.size, line 38, in sizeForDisplay
    num_items = len(self._container)
  Module zope.app.container.sample, line 72, in __len__
    return len(self.__data)
AttributeError: 'Service' object has no attribute '_SampleContainer__data'
"""

I'm newcomer in zope 3 and any idea will be appreciated.
Thanks in advance.

Leticia Larrosa






_______________________________________________
Zope3-users mailing list
Zope3-users at zope.org
http://mail.zope.org/mailman/listinfo/zope3-users










More information about the Zope3-users mailing list