Ignorar:
Timestamp:
12/03/2012 22:20:02 (8 anos atrás)
Autor:
davilima6
Mensagem:

Corrige erro de exibicao das anotacoes do tile (tile.plaintext ainda gera AttributeError?)

Arquivo:
1 editado

Legenda:

Não Modificado
Adicionado
Removido
  • PortalInterlegis/produtos/il.portal.theme/trunk/il/portal/theme/browser/tile.py

    r6104 r6122  
    77from plone import tiles
    88
    9 from z3c.relationfield.schema import RelationChoice
    10 from z3c.relationfield.schema import RelationList
     9#from z3c.relationfield.schema import RelationChoice
     10#from z3c.relationfield.schema import RelationList
    1111
    1212from plone.app.textfield import RichText
    1313from plone.app.textfield.interfaces import ITransformer
    1414
    15 from plone.formwidget.autocomplete.widget import AutocompleteMultiFieldWidget
    16 from plone.formwidget.contenttree import ContentTreeFieldWidget, ObjPathSourceBinder
     15#from plone.formwidget.autocomplete.widget import AutocompleteMultiFieldWidget
     16from plone.formwidget.contenttree import ContentTreeFieldWidget
     17from plone.formwidget.contenttree import MultiContentTreeFieldWidget
    1718from plone.formwidget.contenttree import PathSourceBinder
     19#from plone.formwidget.contenttree import ObjPathSourceBinder
    1820
    1921
    2022class IRichTextTileData(Interface):
     23
    2124    text = RichText(title=u'Text')
    2225
     
    4750
    4851
    49 class IRelatedItensTileData(Interface):
     52class IRelatedItemsTileData(Interface):
    5053
    51     related_itens = RelationChoice(title=u"Escolha o item relacionado",
     54    """
     55    related_item = RelationChoice(title=u"Item relacionado",
    5256                       required=False,
    5357                       source=ObjPathSourceBinder())
     58    """
     59    related_item = Choice(title=u"Item relacionado",
     60                          description=u"Selecione somente um item, por favor",
     61                          required=False,
     62                          source=PathSourceBinder())
    5463
     64    related_items = List(title=u"Múltiplos ítens",
     65                         description=u"Selecione quantos ítens quiser",
     66                         value_type=Choice(title=u"Selection",
     67                                           source=PathSourceBinder()))
    5568    #import pdb;pdb.set_trace()
    5669
    5770
    5871class RelatedForm(form.EditForm):
    59     fields = field.Fields(IRelatedItensTileData)
    60     fields['related_itens'].widgetFactory = ContentTreeFieldWidget
     72    fields = field.Fields(IRelatedItemsTileData)
     73    fields['related_item'].widgetFactory = ContentTreeFieldWidget
     74    fields['related_items'].widgetFactory = MultiContentTreeFieldWidget
     75    mode = 'display'
    6176
    6277RelatedView = layout.wrap_form(RelatedForm)
    6378
    6479
    65 class RelatedItensTile(tiles.PersistentTile):
     80class RelatedItemsTile(tiles.PersistentTile):
    6681
    6782    def __call__(self):
    68         relateditens = ''
    69         if self.data['related_itens']:
    70             relateditens = self.data['related_itens']
    71         return '<html><body>%s</body></html>' % relateditens
     83        related_item = related_items = ''
     84        if self.data['related_item']:
     85            related_item = self.data['related_item']
     86        if self.data['related_items']:
     87            related_items = self.data['related_items']
     88        return '<html><body>%s | %s</body></html>' % (related_item, related_items)
Note: Veja TracChangeset para ajuda no uso do visualizador de conjunto de mudanças.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.