source: publico/ILSAALMaterial/trunk/GrupoMaterial.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: 3.6 KB
Linha 
1# File: GrupoMaterial.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.IGrupoMaterial import IGrupoMaterial
28
29
30from Products.Archetypes.SQLStorage import *
31from Products.ILSAALMaterial.config import *
32##code-section module-header #fill in your manual code here
33##/code-section module-header
34
35schema=Schema((
36    StringField('cod_id',
37        widget=StringWidget(
38            label="Id",
39            description="Codigo de identificacao do grupo ou classe material.",
40            visible={'view':'invisible'},
41            label_msgid='ILSAALMaterial_label_cod_id',
42            description_msgid='ILSAALMaterial_help_cod_id',
43            i18n_domain='ILSAALMaterial',
44        ),
45        mode="rw"
46    ),
47
48    StringField('nom_material',
49        widget=StringWidget(
50            label="Material",
51            description="Nome do material.",
52            label_msgid='ILSAALMaterial_label_nom_material',
53            description_msgid='ILSAALMaterial_help_nom_material',
54            i18n_domain='ILSAALMaterial',
55        )
56    ),
57
58),
59)
60
61
62##code-section after-local-schema #fill in your manual code here
63##/code-section after-local-schema
64
65GrupoMaterial_schema = BaseFolderSchema + \
66    schema
67
68##code-section after-schema #fill in your manual code here
69##/code-section after-schema
70
71class GrupoMaterial(BaseFolder):
72    security = ClassSecurityInfo()
73    __implements__ = (getattr(BaseFolder,'__implements__',()),) + (IGrupoMaterial,)
74
75
76    # This name appears in the 'add' box
77    archetype_name             = 'GrupoMaterial'
78
79    meta_type                  = 'GrupoMaterial'
80    portal_type                = 'GrupoMaterial'
81    allowed_content_types      = ['Material', 'GrupoMaterial']
82    filter_content_types       = 1
83    global_allow               = 0
84    allow_discussion           = 0
85    #content_icon               = 'GrupoMaterial.gif'
86    immediate_view             = 'base_view'
87    default_view               = 'base_view'
88    suppl_views                = ()
89    typeDescription            = "GrupoMaterial"
90    typeDescMsgId              = 'description_edit_grupomaterial'
91
92    schema = GrupoMaterial_schema
93
94    ##code-section class-header #fill in your manual code here
95    ##/code-section class-header
96
97
98    #Methods
99    #methods from Interface IGrupoMaterial
100
101    security.declarePrivate('_titulo')
102    def _titulo(self):
103        """
104        Configuracao do titulo que esse objeto deseja disponibilizar.
105        """
106       
107        return self.getCod_id() + ': ' + self.getNom_material()
108
109
110registerType(GrupoMaterial,PROJECTNAME)
111# end of class GrupoMaterial
112
113##code-section module-footer #fill in your manual code here
114##/code-section module-footer
115
116
117
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.