Greetings<br>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.<br><br>Here's the code:
<br>(I tried the paste bin, but it was done at the moment)<br>class JournalContainer(btree.BTreeContainer):<br>&nbsp;&nbsp;&nbsp; &quot;&quot;&quot;Container of Journals&quot;&quot;&quot;<br><br>&nbsp;&nbsp;&nbsp; implements(interfaces.IJournalContainer
)<br><br>&nbsp;&nbsp;&nbsp; def __init__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(JournalContainer, self).__init__()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._index = persistent.dict.PersistentDict()<br><br>&nbsp;&nbsp;&nbsp; def add(self, journal, person, section):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chooser = INameChooser(self)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name = chooser.chooseName('',journal)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self[name] = journal<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; personHash = hash(IKeyReference(person, None))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sectionHash = hash(IKeyReference(section, None))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self._index[(personHash, sectionHash)] = journal
<br><br>&nbsp;&nbsp;&nbsp; def getJournal(self, person, section):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; import pdb;pdb.set_trace()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; personHash = hash(IKeyReference(person, None))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sectionHash = hash(IKeyReference(section, None))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self._index.get((personHash, sectionHash), None)
<br><br>&nbsp;&nbsp;&nbsp; def remove(self, person, section):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; del self[self.getJournal(person, section).__name__]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; personHash = hash(IKeyReference(person, None))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sectionHash = hash(IKeyReference(section, None))
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; del self._index[(personHash, sectionHash)]<br><br><br>What are we doing wrong/What is causing the problem? How should we go about fixing this.<br><br>Thank you very much.<br>-Eldar Omuraliev<br>