On 18/10/2007, at 11:58 PM, Maken Seteva wrote:

I have a very strange error that I cannot understand. I get an error for one of my attribute only when it is named a certain name! It seems like there is an old implementation of
it that is haunting in the background, how is this possible?

This cursed name is called "tags". This attribute is a list of TextLine. I get the error when I
don't add anything to the list in the adding view:

"TypeError: iteration over non-sequence"

However, if I rename the attribute to "wehoo" or really, anything else, I don't get the TypeError and I can add my content object successfully (with an empty list for wehoo). Here's my component:

class IFoo(IContained):
     tags = List(
         description=_(u'A list of keywords'),

class Foo(Persistent):
        __name__ = __parent__ = None
        def __init__(self):
                self.tags = PersistentList()

No custom widgets used for this field...

I tried deleting all .pyc-files and deleting all old Foo objects, and the site i run for testing followed by restarting the server. But adding new Foo objects still don't work. (But renaming tags to anything else
and then trying again will succeed).

Any ideas?

Add: default=[] to your IFoo schema.


Zope3-users mailing list

Reply via email to