Roundup Tracker - Issues

Message246

Author pohly
Recipients
Date 2002-06-04.08:46:45
Message-id
In-reply-to
I have extended my database scheme to include a new
multilink property, then I used Class.find() to search for
nodes that linked to a certain node.

This did not work because not all nodes have this valid
property:

        # ok, now do the find
        cldb = self.db.getclassdb(self.classname)
        l = []
        for id in self.db.getnodeids(self.classname, cldb):
            node = self.db.getnode(self.classname, id,
cldb)
            if node.has_key(self.db.RETIRED_FLAG):
                continue
            for propname, nodeid in propspec:
                 property = node[propname]
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
=>   File
"/Projects/psp/roundup/roundup-0.4.1/lib/python2.1/site-packages/roundup/hyperdb.py",
line 752, in find
    property = node[propname]
KeyError: product

I replaced the marked line with

                try:
                    property = node[propname]
                except KeyError:
                    # old node without this property
                    continue
History
Date User Action Args
2009-02-03 14:20:01adminlinkissue564271 messages
2009-02-03 14:20:01admincreate