Opa, Rodrigo! Funcionou! Valeu! Te pago uma ceva quando voltares a Porto.
Abraço, Sandro. ---------- Cabeçalho original ----------- De: zope-pt@yahoogrupos.com.br Para: zope-pt@yahoogrupos.com.br Cópia: Data: Thu, 5 Jul 2007 17:07:39 -0300 Assunto: Re: [zope-pt] ReferenceWidget > On 7/5/07, Sandro Augusto Cardoso <[EMAIL PROTECTED]> wrote: > > > > > > Olá, lista! > > Fala Sandro! > > > Em um dos meus schemas há um field do tipo ReferenceField. Alguém sabe se > > existe alguma forma de alterar o > > widget ReferenceWidget para que o mesmo não exiba > > titulo_do_objeto_a_ser_referenciado at > > portal/objeto_a_ser_referenciado no combo select widget ReferenceWidget? > > Gostaria de exibir somente os títulos > > dos objetos, como já é feito quando as opções são mostradas em forma de > > radio buttons (checkbox_bound). > > > > O código do field está a seguir: > > > > schema = Schema(( > > > > ReferenceField( > > name='Localizacao', > > widget=ReferenceWidget( > > label='Localizacao', > > label_msgid='Download_label_Localizacao', > > i18n_domain='Download', > > ), > > allowed_types=('pasta',), > > multiValued=0, > > required=1, > > relationship='arquivo_localizacao' > > ), > > > > ), > > ) > > > > olha soh o arquivo dos fields (Archetypes/Field.py) > > 1550 class ReferenceField(ObjectField): > 1551 """A field for creating references between objects. > 1552 > 1553 get() returns the list of objects referenced under the > relationship > 1554 set() converts a list of target UIDs into references under the > 1555 relationship associated with this field. > 1556 > 1557 If no vocabulary is provided by you, one will be assembled based > on > 1558 allowed_types. > 1559 """ > 1560 > 1561 __implements__ = ObjectField.__implements__ > 1562 > 1563 _properties = Field._properties.copy() > 1564 _properties.update({ > 1565 'type' : 'reference', > 1566 'default' : None, > 1567 'widget' : ReferenceWidget, > 1568 > 1569 'relationship' : None, # required > 1570 'allowed_types' : (), # a tuple of portal types, > empty means allow all > 1571 'allowed_types_method' :None, > 1572 'vocabulary_display_path_bound': 5, # if > len(vocabulary) > 5, we'll > 1573 # display path as well > 1574 'vocabulary_custom_label': None, # e.g. > "b.getObject().title_or_id()". > 1575 # if given, this will > 1576 # override display_path_bound > 1577 'referenceClass' : Reference, > 1578 'referenceReferences' : False, > 1579 'callStorageOnSet': False, > 1580 'index_method' : '_at_edit_accessor', > 1581 }) > > no teu caso vc precisa usar o seguinte: > > 1574 'vocabulary_custom_label': None, # e.g. > "b.getObject().title_or_id()". > 1575 # if given, this will > 1576 # override display_path_bound > > Abraços! > > > Obrigado pela atenção, > > Sandro. > > > > > > > > -- > Castardo > ThreePointsWeb > [EMAIL PROTECTED] > +55 61 8162-2072 >