source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19108_2006_temporal_schema/temporal_reference_system/tm_dateandtime.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/iso_19108_2006_temporal_schema/temporal_reference_system/tm_dateandtime.py@8457
Revision 8457, 2.3 KB checked in by mnagni, 7 years ago (diff)

Corrected an error in the generation of the classes "synchronize" method.

  • Property svn:mime-type set to text/plain
Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ea_model.iso_19108_2006_temporal_schema.temporal_reference_system.tm_caldate import  TM_CalDate
22from ea_model.iso_19108_2006_temporal_schema.temporal_reference_system.tm_clocktime import  TM_ClockTime
23from ascore.utils import has_value, collectionProofHash
24
25'''
26Created on 10-Jul-2012 14:15:02
27
28@author: mnagni
29'''
30
31class TM_DateAndTime(TM_ClockTime,TM_CalDate):
32        '''
33                Represents a data entity defined in a UML diagram and supposed to
34                be persisted in a relational database.
35 
36                This class has been genererated automatically using the Apache Velocity project.
37        '''
38        '''
39                Please note that any access to the inner attributes should be done using
40                the given get/set methods and NOT accessing them directly.
41        '''
42        def __init__(self):
43                self._tm_caldate = TM_CalDate()         
44                self._tm_clocktime = TM_ClockTime()     
45
46                self.indeterminatePosition = None
47                self.frame = None
48                self.calendarEraName = None
49                super(TM_DateAndTime, self).__init__()
50        @property
51        def indeterminatePosition(self):       
52                return self._tm_caldate.indeterminatePosition
53
54        @indeterminatePosition.setter
55        def indeterminatePosition(self, value):
56                        self._tm_caldate.indeterminatePosition = value
57        @property
58        def frame(self):       
59                return self._tm_caldate.frame
60
61        @frame.setter
62        def frame(self, value):
63                        self._tm_caldate.frame = value
64        @property
65        def calendarEraName(self):     
66                return self._tm_caldate.calendarEraName
67
68        @calendarEraName.setter
69        def calendarEraName(self, value):       
70                        self._tm_caldate.calendarEraName = value
71        @property
72        def clkTime(self):     
73                return self._tm_clocktime.clkTime
74
75        @clkTime.setter
76        def clkTime(self, value):       
77                        self._tm_clocktime.clkTime = value
78        @property
79        def calDate(self):     
80                return self._tm_caldate.calDate
81
82        @calDate.setter
83        def calDate(self, value):       
84                        self._tm_caldate.calDate = value
85
86        def synchronize(self):
87                pass
88
89        def __key(self):
90                return (self.indeterminatePosition, self.frame, self.calendarEraName, self.clkTime, self.calDate)
91
92        def __eq__(self, y):
93                if type(self) != type(y):
94                        return False
95                '''
96                Cannot compare classes which do not define a "__key" attribute
97                '''
98                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
99                        return self.__key() == y.__key()
100                return id(self) == id(y)
101
102        def __hash__(self):
103                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.