コード例 #1
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(ProposalGroup, self).to_hash(**flags)
     obj['_id'] = index_hash(unicode_type(self.__data__['proposal']),
                             int(self.__data__['group']))
     obj['group_id'] = int(self.__data__['group'])
     obj['proposal_id'] = unicode_type(self.__data__['proposal'])
     return obj
コード例 #2
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(AToolTransaction, self).to_hash(**flags)
     obj['_id'] = index_hash(int(self.__data__['transaction']),
                             int(self.__data__['analytical_tool']))
     obj['transaction_id'] = int(self.__data__['transaction'])
     obj['analytical_tool_id'] = int(self.__data__['analytical_tool'])
     return obj
コード例 #3
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(CitationTransaction, self).to_hash(**flags)
     obj['_id'] = index_hash(int(self.__data__['transaction']),
                             int(self.__data__['citation']))
     obj['transaction'] = int(self.__data__['transaction'])
     obj['citation'] = int(self.__data__['citation'])
     return obj
コード例 #4
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(CitationProposal, self).to_hash(**flags)
     obj['_id'] = index_hash(int(self.__data__['citation']),
                             unicode_type(self.__data__['proposal']))
     obj['citation_id'] = int(self.__data__['citation'])
     obj['proposal_id'] = unicode_type(self.__data__['proposal'])
     return obj
コード例 #5
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(DOITransaction, self).to_hash(**flags)
     obj['_id'] = index_hash(unicode_type(self.__data__['doi']),
                             int(self.__data__['transaction']))
     obj['doi'] = unicode_type(self.__data__['doi'])
     obj['transaction'] = int(self.__data__['transaction'])
     return obj
コード例 #6
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(UserGroup, self).to_hash(**flags)
     obj['_id'] = index_hash(int(self.__data__['person']),
                             int(self.__data__['group']))
     obj['person_id'] = int(self.__data__['person'])
     obj['group_id'] = int(self.__data__['group'])
     return obj
コード例 #7
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(InstrumentCustodian, self).to_hash(**flags)
     obj['_id'] = index_hash(int(self.__data__['custodian']),
                             int(self.__data__['instrument']))
     obj['instrument_id'] = int(self.__data__['instrument'])
     obj['custodian_id'] = int(self.__data__['custodian'])
     return obj
コード例 #8
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(CitationContributor, self).to_hash(**flags)
     obj['_id'] = index_hash(int(self.__data__['citation']),
                             int(self.__data__['author']))
     obj['citation_id'] = int(self.__data__['citation'])
     obj['author_id'] = int(self.__data__['author'])
     obj['author_precedence'] = int(self.author_precedence)
     return obj
コード例 #9
0
    def to_hash(self, **flags):
        """Convert the object to a hash."""
        obj = super(AToolProposal, self).to_hash(**flags)
        obj['_id'] = index_hash(unicode_type(self.__data__['proposal']),
                                int(self.__data__['analytical_tool']))
        obj['proposal_id'] = unicode_type(self.__data__['proposal'])
        obj['analytical_tool_id'] = int(self.__data__['analytical_tool'])

        return obj
コード例 #10
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(FileKeyValue, self).to_hash(**flags)
     obj['_id'] = index_hash(int(self.__data__['key']),
                             int(self.__data__['file']),
                             int(self.__data__['value']))
     obj['file_id'] = int(self.__data__['file'])
     obj['key_id'] = int(self.__data__['key'])
     obj['value_id'] = int(self.__data__['value'])
     return obj
コード例 #11
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(CitationKeyword, self).to_hash(**flags)
     # pylint: disable=no-member
     obj['_id'] = index_hash(int(self.__data__['citation']),
                             int(self.__data__['keyword']))
     obj['citation_id'] = int(self.__data__['citation'])
     obj['keyword_id'] = int(self.__data__['keyword'])
     # pylint: enable=no-member
     return obj
コード例 #12
0
 def to_hash(self, **flags):
     """Convert the object to a hash."""
     obj = super(TransactionKeyValue, self).to_hash(**flags)
     obj['_id'] = index_hash(int(self.__data__['key']),
                             int(self.__data__['transaction']),
                             int(self.__data__['value']))
     obj['transaction_id'] = int(self.__data__['transaction'])
     obj['key_id'] = int(self.__data__['key'])
     obj['value_id'] = int(self.__data__['value'])
     # obj['kv_pair'] = {'key': int(self.key_id), 'value': int(self.value_id)}
     return obj
コード例 #13
0
 def test_index_hash(self):
     """Test the index hash method with some static knowns."""
     in_data = (123, 456)
     chk_data = 'e10adc3949ba59abbe56e057f20f883e'
     self.assertEqual(index_hash(*in_data), chk_data)