Greetings
I hash some objects and it works fine when I set and get them. However, when I move the Data.fs to a different server on a separate machine running exactly the same code, the hashes don't match.

Here's the code:
(I tried the paste bin, but it was done at the moment)
class JournalContainer(btree.BTreeContainer):
    """Container of Journals"""

    implements(interfaces.IJournalContainer )

    def __init__(self):
        super(JournalContainer, self).__init__()
        self._index = persistent.dict.PersistentDict()

    def add(self, journal, person, section):
        chooser = INameChooser(self)
        name = chooser.chooseName('',journal)
        self[name] = journal
        personHash = hash(IKeyReference(person, None))
        sectionHash = hash(IKeyReference(section, None))
        self._index[(personHash, sectionHash)] = journal

    def getJournal(self, person, section):
        import pdb;pdb.set_trace()
        personHash = hash(IKeyReference(person, None))
        sectionHash = hash(IKeyReference(section, None))
        return self._index.get((personHash, sectionHash), None)

    def remove(self, person, section):
        del self[self.getJournal(person, section).__name__]
        personHash = hash(IKeyReference(person, None))
        sectionHash = hash(IKeyReference(section, None))
        del self._index[(personHash, sectionHash)]


What are we doing wrong/What is causing the problem? How should we go about fixing this.

Thank you very much.
-Eldar Omuraliev
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to