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

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

codigo com o novo modelo corrigido

File size: 5.0 KB
Linha 
1# File: Requisicao.py
2#
3# Copyright (c) 2005 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-RC1 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 <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        default=DateTime(),
53        widget=CalendarWidget(
54            label="Data",
55            description="Informe a data da requisicao.",
56            format="%d/%m/%Y",
57            date_only=1,
58            visible={'edit':'hidden','view':'visible'},
59            label_msgid='ILSAALMaterial_label_dat_requisicao',
60            description_msgid='ILSAALMaterial_help_dat_requisicao',
61            i18n_domain='ILSAALMaterial',
62        ),
63        required=1
64    ),
65
66    StringField('cod_local_entrega',
67        widget=StringWidget(
68            label="Local",
69            description="Informe o codigo do local de entrega.",
70            label_msgid='ILSAALMaterial_label_cod_local_entrega',
71            description_msgid='ILSAALMaterial_help_cod_local_entrega',
72            i18n_domain='ILSAALMaterial',
73        ),
74        required=1
75    ),
76
77    FloatField('vlr_total_requisitado',
78        default="0.00",
79        widget=CurrencyWidget(
80            label="Total",
81            description="Informe o valor total da requisicao.",
82            label_msgid='ILSAALMaterial_label_vlr_total_requisitado',
83            description_msgid='ILSAALMaterial_help_vlr_total_requisitado',
84            i18n_domain='ILSAALMaterial',
85        ),
86        required=1
87    ),
88
89    StringField('cod_status_requisicao',
90        widget=StringWidget(
91            label="Status",
92            description="Status em que se encontra a requisicao.",
93            label_msgid='ILSAALMaterial_label_cod_status_requisicao',
94            description_msgid='ILSAALMaterial_help_cod_status_requisicao',
95            i18n_domain='ILSAALMaterial',
96        )
97    ),
98
99),
100)
101
102
103##code-section after-local-schema #fill in your manual code here
104##/code-section after-local-schema
105
106Requisicao_schema = BaseFolderSchema + \
107    schema
108
109##code-section after-schema #fill in your manual code here
110##/code-section after-schema
111
112class Requisicao(BaseFolder):
113    """
114    Define a requisicao de materiais.
115    """
116    security = ClassSecurityInfo()
117    __implements__ = (getattr(BaseFolder,'__implements__',()),) + (IRequisicao,)
118
119
120    # This name appears in the 'add' box
121    archetype_name             = 'Requisicao'
122
123    meta_type                  = 'Requisicao'
124    portal_type                = 'Requisicao'
125    allowed_content_types      = ['ItemRequisitado']
126    filter_content_types       = 1
127    global_allow               = 0
128    allow_discussion           = 0
129    #content_icon               = 'Requisicao.gif'
130    immediate_view             = 'base_view'
131    default_view               = 'base_view'
132    suppl_views                = ()
133    typeDescription            = "Requisicao"
134    typeDescMsgId              = 'description_edit_requisicao'
135
136    schema = Requisicao_schema
137
138    ##code-section class-header #fill in your manual code here
139    ##/code-section class-header
140
141
142    #Methods
143    #methods from Interface IRequisicao
144
145    security.declarePrivate('_titulo')
146    def _titulo(self):
147        """
148        Configuracao do titulo que esse objeto deseja disponibilizar.
149        """
150       
151        return self.getCod_requisicao() + ': ' + str(self.getDat_requisicao())
152
153
154
155registerType(Requisicao,PROJECTNAME)
156# end of class Requisicao
157
158##code-section module-footer #fill in your manual code here
159##/code-section module-footer
160
161
162
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.