Hi Florain
 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Florian Lindner He
> Sent: Wednesday, May 17, 2006 7:10 PM
> To: zope3-users@zope.org
> Subject: [Zope3-Users] Calling method of superclass
> 
> Hello,
> should be a simple problem, but...
> 
> I have a class that is registered as a NameChooser:
> 
> from zope.app.container.contained import NameChooser
> 
>   class XGMNameChooser(NameChooser):
>     implements(INameChooser)
>     
>     def chooseName(self, name, object):
>         if IAbbreviation.providedBy(object):
>             [...]
>             return n
>         else:
>             return super(NameChooser, self).chooseName(name, object)

Try this:


class XGMNameChooser(NameChooser):
    implements(INameChooser)
     
    def chooseName(self, name, object):
        if IAbbreviation.providedBy(object):
            [...]
            return n
        else:
            return super(XGMNameChooser, self).chooseName(name, object)
                         ^^^^^^^^^^^^^^
Regards
Roger Ineichen


> I want to take care only of the objects that are of type 
> IAbbrevation. But I can't call the 
> 
> File "/home/florian/Desktop/zope/lib/python/xgm/xgm.py", line 
> 35, in chooseName
>     return super(NameChooser, self).chooseName(name, object)
> AttributeError: 'super' object has no attribute 'chooseName'
> 
> What am I doing wrong?
> 
> Florian
> _______________________________________________
> Zope3-users mailing list
> Zope3-users@zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
> 

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

Reply via email to