source: publico/ILPortal/trunk/Telefone.py @ 1242

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

modelo,visoes,css e appinstall atualizados

File size: 3.9 KB
Linha 
1# File: Telefone.py
2#
3# Copyright (c) 2005 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-RC1
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 *
27
28
29
30from Products.Archetypes.SQLStorage import *
31from Products.ILPortal.config import *
32##code-section module-header #fill in your manual code here
33##/code-section module-header
34
35schema=Schema((
36    StringField('title',
37        widget=StringWidget(
38            visible={'edit':'invisible','view':'invisible'},
39            label='Title',
40            label_msgid='ILPortal_label_title',
41            description_msgid='ILPortal_help_title',
42            i18n_domain='ILPortal',
43        ),
44        required=0,
45        accessor="Title",
46        searchable="1"
47    ),
48
49    StringField('local',
50        widget=StringWidget(
51            labale='Local',
52            description='Informe a localização do telefone',
53            label='Local',
54            label_msgid='ILPortal_label_local',
55            description_msgid='ILPortal_help_local',
56            i18n_domain='ILPortal',
57        ),
58        required=1,
59        searchable="1"
60    ),
61
62    StringField('telefone',
63        widget=StringWidget(
64            label='Fone',
65            description='Informe o numero do Telefone',
66            label_msgid='ILPortal_label_telefone',
67            description_msgid='ILPortal_help_telefone',
68            i18n_domain='ILPortal',
69        ),
70        required=1,
71        accessor="getTelefone",
72        searchable="0"
73    ),
74
75),
76)
77
78
79##code-section after-local-schema #fill in your manual code here
80##/code-section after-local-schema
81
82Telefone_schema = BaseSchema + \
83    schema
84
85##code-section after-schema #fill in your manual code here
86##/code-section after-schema
87
88class Telefone(BaseContent):
89    """
90    Telefone da Casa Legislativa.
91    Possui 2 campos: um local e o numero do telefone.
92    """
93    security = ClassSecurityInfo()
94    __implements__ = (getattr(BaseContent,'__implements__',()),)
95
96
97    # This name appears in the 'add' box
98    archetype_name             = 'Telefone'
99
100    meta_type                  = 'Telefone'
101    portal_type                = 'Telefone'
102    allowed_content_types      = []
103    filter_content_types       = 0
104    global_allow               = 0
105    allow_discussion           = 0
106    content_icon               = 'Telefone.gif'
107    immediate_view             = 'base_view'
108    default_view               = 'base_view'
109    suppl_views                = ()
110    typeDescription            = "Telefone"
111    typeDescMsgId              = 'description_edit_telefone'
112
113    schema = Telefone_schema
114
115    ##code-section class-header #fill in your manual code here
116    ##/code-section class-header
117
118
119    #Methods
120
121    security.declareProtected("View", 'setLocal')
122    def setLocal(self,valor):
123        """ seta o nome do telefone e o titulo do objeto"""
124        self.getField('local').set(self, valor)
125        self.getField('title').set(self, self.getLocal())
126        self.reindexObject()
127
128
129
130registerType(Telefone,PROJECTNAME)
131# end of class Telefone
132
133##code-section module-footer #fill in your manual code here
134##/code-section module-footer
135
136
137
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.