source: publico/ILSAALMaterial/trunk/Requisicao.py @ 781

Última Alteração nesse arquivo desde 781 foi 781, incluída por brunopinheiro, 14 anos atrás

Implementados mtodos _titulo() das classes e fechado ticket #57.

File size: 5.4 KB
Linha 
1# File: Requisicao.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
25from AccessControl import ClassSecurityInfo
26from Products.Archetypes.atapi import *
27from Products.ILSAALMaterial.interfaces.IRequisicao import IRequisicao
28
29
30from Products.Archetypes.SQLStorage import *
31# additional imports from tagged value 'import'
32from DateTime import DateTime
33from Products.ILSAAL.saalapi import *
34
35from Products.ILSAALMaterial.config import *
36##code-section module-header #fill in your manual code here
37##/code-section module-header
38
39schema=Schema((
40    StringField('cod_requisicao',
41        widget=StringWidget(
42            label="Codigo",
43            description="Informe o codigo da requisicao.",
44            label_msgid='ILSAALMaterial_label_cod_requisicao',
45            description_msgid='ILSAALMaterial_help_cod_requisicao',
46            i18n_domain='ILSAALMaterial',
47        ),
48        required=1
49    ),
50
51    DateTimeField('dat_requisicao',
52        widget=CalendarWidget(
53            label="Data",
54            description="Informe a data da requisicao.",
55            format="%d/%m/%Y",
56            date_only=1,
57            label_msgid='ILSAALMaterial_label_dat_requisicao',
58            description_msgid='ILSAALMaterial_help_dat_requisicao',
59            i18n_domain='ILSAALMaterial',
60        ),
61        required=1
62    ),
63
64    StringField('cod_local_entrega',
65        widget=StringWidget(
66            label="Local",
67            description="Informe o codigo do local de entrega.",
68            label_msgid='ILSAALMaterial_label_cod_local_entrega',
69            description_msgid='ILSAALMaterial_help_cod_local_entrega',
70            i18n_domain='ILSAALMaterial',
71        ),
72        required=1
73    ),
74
75    FloatField('vlr_total_requisitado',
76        widget=DecimalWidget(
77            label="Total",
78            description="Informe o valor total da requisicao.",
79            label_msgid='ILSAALMaterial_label_vlr_total_requisitado',
80            description_msgid='ILSAALMaterial_help_vlr_total_requisitado',
81            i18n_domain='ILSAALMaterial',
82        ),
83        required=1
84    ),
85
86    StringField('cod_status_requisicao',
87        widget=StringWidget(
88            label="Status",
89            description="Status em que se encontra a requisicao.",
90            label_msgid='ILSAALMaterial_label_cod_status_requisicao',
91            description_msgid='ILSAALMaterial_help_cod_status_requisicao',
92            i18n_domain='ILSAALMaterial',
93        )
94    ),
95
96
97    ReferenceField('cod_matricula_req',
98        widget=ReferenceWidget(
99            label='Cod_matricula_req',
100            label_msgid='ILSAALMaterial_label_cod_matricula_req',
101            description_msgid='ILSAALMaterial_help_cod_matricula_req',
102            i18n_domain='ILSAALMaterial',
103        ),
104        allowed_types=('Requisitante',),
105        multiValued=0,
106        relationship='Requisicao_Requisitante'
107    ),
108
109),
110)
111
112
113##code-section after-local-schema #fill in your manual code here
114##/code-section after-local-schema
115
116Requisicao_schema = BaseFolderSchema + \
117    schema
118
119##code-section after-schema #fill in your manual code here
120##/code-section after-schema
121
122class Requisicao(BaseFolder):
123    """
124    Define a requisicao de materiais.
125    """
126    security = ClassSecurityInfo()
127    __implements__ = (getattr(BaseFolder,'__implements__',()),) + (IRequisicao,)
128
129
130    # This name appears in the 'add' box
131    archetype_name             = 'Requisicao'
132
133    meta_type                  = 'Requisicao'
134    portal_type                = 'Requisicao'
135    allowed_content_types      = ['ItemRequisitado', 'ItemRequisitadoCancelado', 'ItemRequisitadoAtendido']
136    filter_content_types       = 1
137    global_allow               = 0
138    allow_discussion           = 0
139    #content_icon               = 'Requisicao.gif'
140    immediate_view             = 'base_view'
141    default_view               = 'base_view'
142    suppl_views                = ()
143    typeDescription            = "Requisicao"
144    typeDescMsgId              = 'description_edit_requisicao'
145
146    schema = Requisicao_schema
147
148    ##code-section class-header #fill in your manual code here
149    ##/code-section class-header
150
151
152    #Methods
153    #methods from Interface IRequisicao
154
155    security.declarePrivate('_titulo')
156    def _titulo(self):
157        """
158        Configuracao do titulo que esse objeto deseja disponibilizar.
159        """
160       
161        return self.getCod_requisicao() + ': ' + str(self.getDat_requisicao())
162
163
164
165registerType(Requisicao,PROJECTNAME)
166# end of class Requisicao
167
168##code-section module-footer #fill in your manual code here
169##/code-section module-footer
170
171
172
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.