1 | # File: Requisitante.py |
---|
2 | # |
---|
3 | # Copyright (c) 2005 by Interlegis |
---|
4 | # Generator: ArchGenXML Version 1.4.0-beta2 devel |
---|
5 | # http://plone.org/products/archgenxml |
---|
6 | # |
---|
7 | # GNU General Public Licence (GPL) |
---|
8 | # |
---|
9 | # This program is free software; you can redistribute it and/or modify it under |
---|
10 | # the terms of the GNU General Public License as published by the Free Software |
---|
11 | # Foundation; either version 2 of the License, or (at your option) any later |
---|
12 | # version. |
---|
13 | # This program is distributed in the hope that it will be useful, but WITHOUT |
---|
14 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
15 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
---|
16 | # details. |
---|
17 | # You should have received a copy of the GNU General Public License along with |
---|
18 | # this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
19 | # Place, Suite 330, Boston, MA 02111-1307 USA |
---|
20 | # |
---|
21 | __author__ = '''STC Interlegis <admin-stc@interlegis.gov.br>''' |
---|
22 | __docformat__ = 'plaintext' |
---|
23 | |
---|
24 | |
---|
25 | from AccessControl import ClassSecurityInfo |
---|
26 | from Products.Archetypes.atapi import * |
---|
27 | from Products.ILSAALMaterial.interfaces.IRequisitante import IRequisitante |
---|
28 | |
---|
29 | |
---|
30 | from Products.Archetypes.SQLStorage import * |
---|
31 | # additional imports from tagged value 'import' |
---|
32 | from DateTime import DateTime |
---|
33 | from Products.ILSAAL.saalapi import * |
---|
34 | |
---|
35 | from Products.ILSAALMaterial.config import * |
---|
36 | ##code-section module-header #fill in your manual code here |
---|
37 | ##/code-section module-header |
---|
38 | |
---|
39 | schema=Schema(( |
---|
40 | StringField('cod_matricula_req', |
---|
41 | widget=StringWidget( |
---|
42 | label="Matricula do Requisitante", |
---|
43 | description="Informe a matricula do requisitante.", |
---|
44 | label_msgid='ILSAALMaterial_label_cod_matricula_req', |
---|
45 | description_msgid='ILSAALMaterial_help_cod_matricula_req', |
---|
46 | i18n_domain='ILSAALMaterial', |
---|
47 | ), |
---|
48 | required=1 |
---|
49 | ), |
---|
50 | |
---|
51 | StringField('nom_requisitante', |
---|
52 | widget=StringWidget( |
---|
53 | label="Nome do Requisitante", |
---|
54 | description="Informe o nome do requisitante.", |
---|
55 | label_msgid='ILSAALMaterial_label_nom_requisitante', |
---|
56 | description_msgid='ILSAALMaterial_help_nom_requisitante', |
---|
57 | i18n_domain='ILSAALMaterial', |
---|
58 | ), |
---|
59 | required=1 |
---|
60 | ), |
---|
61 | |
---|
62 | DateTimeField('dat_inicio', |
---|
63 | widget=CalendarWidget( |
---|
64 | label="Data Inicio", |
---|
65 | description="Informe a data de inicio da requisicao.", |
---|
66 | format="%d/%m/%Y", |
---|
67 | date_only=1, |
---|
68 | label_msgid='ILSAALMaterial_label_dat_inicio', |
---|
69 | description_msgid='ILSAALMaterial_help_dat_inicio', |
---|
70 | i18n_domain='ILSAALMaterial', |
---|
71 | ), |
---|
72 | required=1 |
---|
73 | ), |
---|
74 | |
---|
75 | DateTimeField('dat_termino', |
---|
76 | widget=CalendarWidget( |
---|
77 | label="Data Termino", |
---|
78 | description="Informe a data final da requisicao.", |
---|
79 | format="%d/%m/%Y", |
---|
80 | date_only=1, |
---|
81 | label_msgid='ILSAALMaterial_label_dat_termino', |
---|
82 | description_msgid='ILSAALMaterial_help_dat_termino', |
---|
83 | i18n_domain='ILSAALMaterial', |
---|
84 | ) |
---|
85 | ), |
---|
86 | |
---|
87 | |
---|
88 | ReferenceField('cod_local', |
---|
89 | widget=ReferenceWidget( |
---|
90 | label='Cod_local', |
---|
91 | label_msgid='ILSAALMaterial_label_cod_local', |
---|
92 | description_msgid='ILSAALMaterial_help_cod_local', |
---|
93 | i18n_domain='ILSAALMaterial', |
---|
94 | ), |
---|
95 | allowed_types=('Local',), |
---|
96 | multiValued=0, |
---|
97 | relationship='Requisitante_Local' |
---|
98 | ), |
---|
99 | |
---|
100 | ), |
---|
101 | ) |
---|
102 | |
---|
103 | |
---|
104 | ##code-section after-local-schema #fill in your manual code here |
---|
105 | ##/code-section after-local-schema |
---|
106 | |
---|
107 | Requisitante_schema = BaseSchema + \ |
---|
108 | schema |
---|
109 | |
---|
110 | ##code-section after-schema #fill in your manual code here |
---|
111 | ##/code-section after-schema |
---|
112 | |
---|
113 | class Requisitante(BaseContent): |
---|
114 | """ |
---|
115 | Representa o ator requisitante. |
---|
116 | """ |
---|
117 | security = ClassSecurityInfo() |
---|
118 | __implements__ = (getattr(BaseContent,'__implements__',()),) + (IRequisitante,) |
---|
119 | |
---|
120 | |
---|
121 | # This name appears in the 'add' box |
---|
122 | archetype_name = 'Requisitante' |
---|
123 | |
---|
124 | meta_type = 'Requisitante' |
---|
125 | portal_type = 'Requisitante' |
---|
126 | allowed_content_types = [] |
---|
127 | filter_content_types = 0 |
---|
128 | global_allow = 0 |
---|
129 | allow_discussion = 0 |
---|
130 | #content_icon = 'Requisitante.gif' |
---|
131 | immediate_view = 'base_view' |
---|
132 | default_view = 'base_view' |
---|
133 | suppl_views = () |
---|
134 | typeDescription = "Requisitante" |
---|
135 | typeDescMsgId = 'description_edit_requisitante' |
---|
136 | |
---|
137 | schema = Requisitante_schema |
---|
138 | |
---|
139 | ##code-section class-header #fill in your manual code here |
---|
140 | ##/code-section class-header |
---|
141 | |
---|
142 | |
---|
143 | #Methods |
---|
144 | #methods from Interface IRequisitante |
---|
145 | |
---|
146 | security.declarePrivate('_titulo') |
---|
147 | def _titulo(self): |
---|
148 | """ |
---|
149 | Configuracao do titulo que esse objeto deseja disponibilizar |
---|
150 | """ |
---|
151 | |
---|
152 | return self.getCod_matricula() + ':' + self.getNome_requisitante() |
---|
153 | |
---|
154 | |
---|
155 | |
---|
156 | registerType(Requisitante,PROJECTNAME) |
---|
157 | # end of class Requisitante |
---|
158 | |
---|
159 | ##code-section module-footer #fill in your manual code here |
---|
160 | ##/code-section module-footer |
---|
161 | |
---|
162 | |
---|
163 | |
---|