source: publico/ILPortal/trunk/MesaDiretora.py @ 2225

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

alteração no modelo e geração de código

File size: 4.1 KB
Linha 
1# -*- coding: utf-8 -*-
2#
3# File: MesaDiretora.py
4#
5# Copyright (c) 2006 by Interlegis
6# Generator: ArchGenXML Version 1.5.0 svn/devel
7#            http://plone.org/products/archgenxml
8#
9# GNU General Public License (GPL)
10#
11# This program is free software; you can redistribute it and/or
12# modify it under the terms of the GNU General Public License
13# as published by the Free Software Foundation; either version 2
14# of the License, or (at your option) any later version.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with this program; if not, write to the Free Software
23# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24# 02110-1301, USA.
25#
26
27__author__ = """STC Interlegis <admin-stc@interlegis.gov.br>"""
28__docformat__ = 'plaintext'
29
30from AccessControl import ClassSecurityInfo
31from Products.Archetypes.atapi import *
32from Products.Archetypes.SQLStorage import *
33from Products.ILPortal.config import *
34
35# additional imports from tagged value 'import'
36from Products.CMFDynamicViewFTI.browserdefault import BrowserDefaultMixin
37
38##code-section module-header #fill in your manual code here
39##/code-section module-header
40
41schema = Schema((
42
43    StringField(
44        name='title',
45        widget=StringWidget(
46            description="Informe um título para a Mesa Diretora",
47            label="Título",
48            label_msgid='ILPortal_label_title',
49            description_msgid='ILPortal_help_title',
50            i18n_domain='ILPortal',
51        ),
52        required=1,
53        storage=PostgreSQLStorage(),
54        accessor="Title",
55        searchable=1
56    ),
57
58    TextField(
59        name='description',
60        widget=TextAreaWidget(
61            label="Descrição",
62            description="Informe uma breve descrição para a mesa diretora.",
63            label_msgid='ILPortal_label_description',
64            description_msgid='ILPortal_help_description',
65            i18n_domain='ILPortal',
66        ),
67        required=0,
68        accessor="Description",
69        searchable=1
70    ),
71
72),
73)
74
75##code-section after-local-schema #fill in your manual code here
76##/code-section after-local-schema
77
78MesaDiretora_schema = BaseFolderSchema.copy() + \
79    schema.copy()
80
81##code-section after-schema #fill in your manual code here
82##/code-section after-schema
83
84class MesaDiretora(BrowserDefaultMixin, OrderedBaseFolder):
85    """Mesa Diretora para inclusao dos membros da mesa.
86    Possui um campo texto que eh mostrado no topo do folder_listing.
87    """
88    security = ClassSecurityInfo()
89    __implements__ = (getattr(BrowserDefaultMixin,'__implements__',()),) + (getattr(OrderedBaseFolder,'__implements__',()),)
90
91    # This name appears in the 'add' box
92    archetype_name = 'Mesa Diretora'
93
94    meta_type = 'MesaDiretora'
95    portal_type = 'MesaDiretora'
96    allowed_content_types = ['MembroMesaDiretora']
97    filter_content_types = 1
98    global_allow = 0
99    allow_discussion = False
100    content_icon = 'folder_icon.gif'
101    immediate_view = 'folder_listing'
102    default_view = 'mesa_view'
103    suppl_views = ('mesa_view','folder_tabular_view')
104    typeDescription = "Mesa Diretora"
105    typeDescMsgId = 'description_edit_mesadiretora'
106
107
108    actions =  (
109
110
111       {'action': "string:${object_url}/view",
112        'category': "object",
113        'id': 'view',
114        'name': 'View',
115        'permissions': ("View",),
116        'condition': 'python:1'
117       },
118
119
120    )
121
122    _at_rename_after_creation = True
123
124    schema = MesaDiretora_schema
125
126    ##code-section class-header #fill in your manual code here
127    ##/code-section class-header
128
129    # Methods
130
131def modify_fti(fti):
132    # Hide unnecessary tabs (usability enhancement)
133    for a in fti['actions']:
134        if a['id'] in ['references']:
135            a['visible'] = 0
136    return fti
137
138registerType(MesaDiretora, PROJECTNAME)
139# end of class MesaDiretora
140
141##code-section module-footer #fill in your manual code here
142##/code-section module-footer
143
144
145
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.