source: mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/topology/topological_primitive/tp_solidboundary.py @ 8087

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/ea_model/iso_19107_2003_spatial_schema/topology/topological_primitive/tp_solidboundary.py@8087
Revision 8087, 1.5 KB checked in by mnagni, 8 years ago (diff)

Imported a new DB library which fixes the MO_ObservationColleciton <--> CEDA_ObservationCollection problem

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