Hi lupa!
your suggestion don't work's :-(
here's the class of my Archetype
__author__ = """Marcos Daniel Petry <***@ucs.br>"""
__docformat__ = 'plaintext'
from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from Products.UCSEventosCate.config import *
from Products.UCSEventosCate.vocabularios import *
schema = Schema((
StringField(
name='local',
widget=SelectionWidget(
format="select",
label="Local do Evento",
label_msgid='UCSEventosCate_label_local',
i18n_domain='UCSEventosCate',
),
vocabulary=lista_locais
),
StringField(
name='solicitacao_servico',
widget=StringWidget(
label="Solicitação de Serviço",
label_msgid='UCSEventosCate_label_solicitacao_servico',
i18n_domain='UCSEventosCate',
)
),
DateTimeField(
name='data_inicio',
widget=CalendarWidget(
label="Início do eevento",
label_msgid='UCSEventosCate_label_data_inicio',
i18n_domain='UCSEventosCate',
),
required=1
),
DateTimeField(
name='data_fim',
widget=CalendarWidget(
label="Fim do Evento",
label_msgid='UCSEventosCate_label_data_fim',
i18n_domain='UCSEventosCate',
),
required=1
),
StringField(
name='tipoEvento',
widget=SelectionWidget(
format="select",
label="Tipo do Evento",
label_msgid='UCSEventosCate_label_tipoEvento',
i18n_domain='UCSEventosCate',
),
required=1,
vocabulary=lista_tipos_eventos
),
StringField(
name='responsavel',
widget=StringWidget(
label="Responsável",
label_msgid='UCSEventosCate_label_responsavel',
i18n_domain='UCSEventosCate',
)
),
),
)
EventoDipa_schema = BaseSchema.copy() + \
schema.copy()
class EventoDipa(BaseContent):
"""
"""
security = ClassSecurityInfo()
__implements__ = (getattr(BaseContent,'__implements__',()),)
archetype_name = 'EventoDipa'
meta_type = 'EventoDipa'
portal_type = 'EventoDipa'
allowed_content_types = []
filter_content_types = 0
global_allow = 0
#content_icon = 'EventoDipa.gif'
immediate_view = 'base_view'
default_view = 'base_view'
suppl_views = ()
typeDescription = "EventoDipa"
typeDescMsgId = 'description_edit_eventodipa'
_at_rename_after_creation = True
schema = EventoDipa_schema
security.declarePublic('start')
def start(self):
"""
"""
return self.getData_inicio()
security.declarePublic('end')
def end(self):
"""
"""
return self.getData_fim()
security.declarePublic('Subject')
def Subject(self):
"""
"""
return self.getLocal()
security.declarePublic('Description')
def Description(self):
"""
"""
return self.getTipoEvento()
is it correct?
Post by +lupa+Hello Marcos,
Try declaring methods getSubject() and getDescription() to return the
fields "local" and "tipo_evento". That's my first guess, without looking
at any code. Those are the default Archetypes handlers for these
attributes, and should work the same way that start() and end() do for you
now.
Oh, and the subject field (your "local" attribute, I presume) should be a
lines field, so that users can have more than one subject to choose from.
Congratulations on your early success, and keep us informed as to your next
successes.
+lupa+
Post by Marcos Daniel PetryHi,
I've created a Product with Archetypes, with these fields
nome
local
sol_servico
data_inicio
data_fim
tipo_evento
I declared the methods start() and end() to returns the fields
"data_inicio"and "data_fim" for display the values in the Calendar, and
it's woks!
but, in month view, when put the mouse over the event, appears a box with
Subject and Description and I don't know how to put the values "local: and
"tipo_evento" in this box
plz help me with this problem!
thanks
Petry
*PS.: Sorry for my English, it's not very well! :-)