source: mauRepo/MolesManager/trunk/src/ea_model/upcomingiso/ci_responsiblepartyinfo.py @ 8147

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/upcomingiso/ci_responsiblepartyinfo.py@8147
Revision 8147, 1.1 KB checked in by mnagni, 8 years ago (diff)

Implementation of tickets #22390

RevLine 
[8045]1
2
3
4
5
6
7
8
9
10
11
12
13
[8074]14
15
16
17
[8088]18
19
20
[8147]21from ascore.utils import has_value, collectionProofHash
[8086]22
[8045]23'''
[8091]24Created on 16-Feb-2012 16:18:09
[8045]25
26@author: mnagni
27'''
28
29class CI_ResponsiblePartyInfo(object):
[8074]30    '''
31        Represents a data entity defined in a UML diagram and supposed to
32        be persisted in a relational database.
[8045]33 
[8074]34        This class has been genererated automatically using the Apache Velocity project.
35    '''
36    '''
37        Please note that any access to the inner attributes should be done using
38        the given get/set methods and NOT accessing them directly.
39    '''
40    def __init__(self):
[8045]41
[8074]42        self.extent = []
43        self.role = None
44        super(CI_ResponsiblePartyInfo, self).__init__()
[8045]45
[8086]46    def __key(self):
47        return (self.extent, self.role)
48
[8088]49    def __eq__(self, y):
[8086]50        '''
51        Cannot compare classes which do not define a "__key" attribute
52        '''
[8088]53        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
54            return self.__key() == y.__key()
55        return id(self) == id(y)
[8086]56
57    def __hash__(self):
[8147]58        return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.