Ignore:
Timestamp:
8 Mar 2012, 07:45:44 (13 years ago)
Author:
Henrik Bettermann
Message:

Let's also customize the SequenceDisplayWidget? to avoid line numbering.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/widgets/sequencewidget.py

    r7795 r7797  
    2323import grok
    2424from zope.browserpage import ViewPageTemplateFile
    25 from zope.formlib.interfaces import IInputWidget
    26 from zope.formlib.widgets import ListSequenceWidget
     25from zope.formlib.interfaces import IInputWidget, IDisplayWidget
     26from zope.formlib.widgets import (
     27    ListSequenceWidget, SequenceDisplayWidget)
    2728from zope.publisher.interfaces.browser import IBrowserRequest
    2829from zope.schema.interfaces import IField, IList
     
    3637    template = ViewPageTemplateFile('sequencewidget.pt')
    3738
     39class KofaSequenceDisplayWidget(SequenceDisplayWidget):
     40    """A sequence widget for lists.
    3841
    39 # Register our sequence widget as default for lists.
     42    This is basically a plain copy from zope.formlib. We have,
     43    however, the possibility to tweak html tags.
     44    """
     45
     46    tag = None
     47    itemTag = None
     48
     49# Register our sequence widgets as default for lists.
    4050@grok.adapter(IList, IField, IBrowserRequest)
    4151@grok.implementer(IInputWidget)
    4252def seq_input_widget(obj, field, req, *args, **kw):
    4353    return SIRPSequenceWidget(obj, field, req, *args, **kw)
     54
     55@grok.adapter(IList, IField, IBrowserRequest)
     56@grok.implementer(IDisplayWidget)
     57def seq_display_widget(obj, field, req, *args, **kw):
     58    return KofaSequenceDisplayWidget(obj, field, req, *args, **kw)
Note: See TracChangeset for help on using the changeset viewer.