source: mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/moles3_4/utilities/mo_citation.py @ 8457

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/CedaMolesModel/trunk/ceda_moles_model/ea_model/moles3_4/utilities/mo_citation.py@8457
Revision 8457, 3.7 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_19115_2006_metadata_corrigendum.citation_and_responsible_party_information.ci_citation import  CI_Citation
22from ascore.utils import has_value, collectionProofHash
23
24'''
25Created on 10-Jul-2012 14:15:04
26
27@author: mnagni
28'''
29
30class MO_Citation(CI_Citation):
31        '''
32                Represents a data entity defined in a UML diagram and supposed to
33                be persisted in a relational database.
34 
35                This class has been genererated automatically using the Apache Velocity project.
36        '''
37        '''
38                Please note that any access to the inner attributes should be done using
39                the given get/set methods and NOT accessing them directly.
40        '''
41        def __init__(self):
42                self._ci_citation = CI_Citation()       
43
44                self.editionDate = None
45                self.collectiveTitle = None
46                self.ISSN = None
47                self.edition = None
48                self.title = None
49                self.otherCitationDetails = None
50                self.series = None
51                self.onlineResource = []
52                self.ISBN = None
53                super(MO_Citation, self).__init__()
54        @property
55        def presentationForm(self):     
56                return self._ci_citation.presentationForm
57
58        @presentationForm.setter
59        def presentationForm(self, value):     
60                        self._ci_citation.presentationForm = value
61        @property
62        def editionDate(self): 
63                return self._ci_citation.editionDate
64
65        @editionDate.setter
66        def editionDate(self, value):   
67                        self._ci_citation.editionDate = value
68        @property
69        def collectiveTitle(self):     
70                return self._ci_citation.collectiveTitle
71
72        @collectiveTitle.setter
73        def collectiveTitle(self, value):       
74                        self._ci_citation.collectiveTitle = value
75        @property
76        def date(self):
77                return self._ci_citation.date
78
79        @date.setter
80        def date(self, value): 
81                        self._ci_citation.date = value
82        @property
83        def ISSN(self):
84                return self._ci_citation.ISSN
85
86        @ISSN.setter
87        def ISSN(self, value): 
88                        self._ci_citation.ISSN = value
89        @property
90        def alternateTitle(self):       
91                return self._ci_citation.alternateTitle
92
93        @alternateTitle.setter
94        def alternateTitle(self, value):       
95                        self._ci_citation.alternateTitle = value
96        @property
97        def edition(self):     
98                return self._ci_citation.edition
99
100        @edition.setter
101        def edition(self, value):       
102                        self._ci_citation.edition = value
103        @property
104        def identifier(self):   
105                return self._ci_citation.identifier
106
107        @identifier.setter
108        def identifier(self, value):   
109                        self._ci_citation.identifier = value
110        @property
111        def title(self):       
112                return self._ci_citation.title
113
114        @title.setter
115        def title(self, value):
116                        self._ci_citation.title = value
117        @property
118        def otherCitationDetails(self):
119                return self._ci_citation.otherCitationDetails
120
121        @otherCitationDetails.setter
122        def otherCitationDetails(self, value): 
123                        self._ci_citation.otherCitationDetails = value
124        @property
125        def series(self):       
126                return self._ci_citation.series
127
128        @series.setter
129        def series(self, value):       
130                        self._ci_citation.series = value
131        @property
132        def citedResponsibleParty(self):       
133                return self._ci_citation.citedResponsibleParty
134
135        @citedResponsibleParty.setter
136        def citedResponsibleParty(self, value):
137                        self._ci_citation.citedResponsibleParty = value
138        @property
139        def ISBN(self):
140                return self._ci_citation.ISBN
141
142        @ISBN.setter
143        def ISBN(self, value): 
144                        self._ci_citation.ISBN = value
145
146        def synchronize(self):
147                pass
148
149        def __key(self):
150                return (self.presentationForm, self.editionDate, self.collectiveTitle, self.date, self.ISSN, self.alternateTitle, self.edition, self.identifier, self.title, self.otherCitationDetails, self.series, self.onlineResource, self.citedResponsibleParty, self.ISBN)
151
152        def __eq__(self, y):
153                if type(self) != type(y):
154                        return False
155                '''
156                Cannot compare classes which do not define a "__key" attribute
157                '''
158                if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
159                        return self.__key() == y.__key()
160                return id(self) == id(y)
161
162        def __hash__(self):
163                return collectionProofHash(self.__key())
Note: See TracBrowser for help on using the repository browser.