source: mauRepo/MolesManager/trunk/src/ea_model/iso_19135_2005_procedures_for_registration/re_submittingorganization.py @ 8088

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

New ea_model library.
No more use the django.forms. Now uses JSON and Dojo(javascript)
DB creation files are now executed as standard python function (before was used a system execution call)
Added an html example to play/work offline with DOJO

Line 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21from ascore.utils import has_value
22
23'''
24Created on 10-Feb-2012 12:03:07
25
26@author: mnagni
27'''
28
29class RE_SubmittingOrganization(object):
30    '''
31        Represents a data entity defined in a UML diagram and supposed to
32        be persisted in a relational database.
33 
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):
41
42        self.name = None
43        self._register_cl_classificationregister = []
44        self._register_cl_classificationregister = []
45        self._proposalInformation_re_additioninformation = []
46        self._proposalInformation_re_amendmentinformation = []
47        self._proposalInformation_re_clarificationinformation = []
48        self.contact = None
49        super(RE_SubmittingOrganization, self).__init__()
50
51    @property
52    def register(self): 
53        ret = []
54        for item in self._register_cl_classificationregister:
55            ret.append(item)
56        for item in self._register_cl_classificationregister:
57            ret.append(item)
58        return ret
59
60    @register.setter
61    def register(self, value): 
62        if isinstance(value, list):
63            self._register_cl_classificationregister[:]
64            self._register_cl_classificationregister[:]
65            for item in value:
66                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
67                if valueClass == "ea_model.iso_19144_1_classification_systems.cl_classificationregister.CL_ClassificationRegister":
68                    self._register_cl_classificationregister.append(item)
69                    continue
70                if valueClass == "ea_model.iso_19144_1_classification_systems.cl_classificationregister.CL_ClassificationRegister":
71                    self._register_cl_classificationregister.append(item)
72                    continue
73
74    @property
75    def proposalInformation(self):     
76        ret = []
77        for item in self._proposalInformation_re_additioninformation:
78            ret.append(item)
79        for item in self._proposalInformation_re_amendmentinformation:
80            ret.append(item)
81        for item in self._proposalInformation_re_clarificationinformation:
82            ret.append(item)
83        return ret
84
85    @proposalInformation.setter
86    def proposalInformation(self, value):       
87        if isinstance(value, list):
88            self._proposalInformation_re_additioninformation[:]
89            self._proposalInformation_re_amendmentinformation[:]
90            self._proposalInformation_re_clarificationinformation[:]
91            for item in value:
92                valueClass = "%s.%s" % (type(value).__module__,type(value).__name__)
93                if valueClass == "ea_model.iso_19135_2005_procedures_for_registration.re_additioninformation.RE_AdditionInformation":
94                    self._proposalInformation_re_additioninformation.append(item)
95                    continue
96                if valueClass == "ea_model.iso_19135_2005_procedures_for_registration.re_amendmentinformation.RE_AmendmentInformation":
97                    self._proposalInformation_re_amendmentinformation.append(item)
98                    continue
99                if valueClass == "ea_model.iso_19135_2005_procedures_for_registration.re_clarificationinformation.RE_ClarificationInformation":
100                    self._proposalInformation_re_clarificationinformation.append(item)
101                    continue
102
103    def __key(self):
104        return (self.name, self.register, self.proposalInformation, self.contact)
105
106    def __eq__(self, y):
107        '''
108        Cannot compare classes which do not define a "__key" attribute
109        '''
110        if hasattr(self, '_%s__key' % (type(self).__name__)) and hasattr(y, '_%s__key' % (type(y).__name__)):
111            return self.__key() == y.__key()
112        return id(self) == id(y)
113
114    def __hash__(self):
115        return hash(self.__key())
Note: See TracBrowser for help on using the repository browser.