Changeset 7856 for main


Ignore:
Timestamp:
12 Mar 2012, 17:10:32 (13 years ago)
Author:
uli
Message:

More cleanups.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/widgets/phonewidget.py

    r7852 r7856  
    88will be used for rendering).
    99
    10 The code was mainly taken from usphone implementation in z3c.widget
    11 (which was designed for outdated zope.app.form (instead of
    12 zope.formlib or newer form libs). Therefore some modifications were
    13 neccessary and it might look a bit overloaded.
    14 
    1510If you use the PhoneWidget for rendering regular TextLine attributes
    1611(preferably in edit forms or add forms), the phone number is displayed
    1712by three input fields representing the international code, the area
    18 code and the extension line. All three fields require pure numbers as
    19 input and do not accept other chars.
     13code and the extension line.
    2014
    2115When the entered input is stored with a context object, it is stored
    2216as a single unicode string with the numbers divided by single hyphen.
    2317
    24 So, input <12>, <111>, <444> becomes the string ``'12-111-444'`` for
     18So, input <+12>, <111>, <444> becomes the string ``'+12-111-444'`` for
    2519the context object.
    26 
    27 Large parts of this module are copied from z3c.widget and may be
    28 covered by ZPL.
    29 
    3020"""
    3121import grok
    3222import re
    33 import copy
    34 from waeup.kofa.interfaces import MessageFactory as _
    35 from zope import schema
    36 from zope.browserpage import ViewPageTemplateFile
    37 from zope.component import getMultiAdapter
    38 from zope.formlib import form
    39 from zope.formlib.interfaces import (
    40     IBrowserWidget, IWidgetInputErrorView, IInputWidget, WidgetInputError,
    41     MissingInputError)
    42 from zope.formlib.widget import SimpleInputWidget
    43 from zope.interface import Interface, implements
    44 from zope.schema.interfaces import RequiredMissing
    45 
    46 
    47 from zc.sourcefactory.contextual import BasicContextualSourceFactory
     23from zope.component import getUtility
     24from zope.formlib.interfaces import MissingInputError, InputErrors
     25from zope.interface import Interface
    4826from zope.formlib.textwidgets import (
    4927    TextWidget, renderElement, ConversionError)
    50 from zope.formlib.widget import ValidationError
    51 from zope.component import getUtility
    52 from zope.interface import Invalid
    53 from zope.formlib.interfaces import (
    54     WidgetInputError, MissingInputError, InputErrors,)
    55 from zope.schema.interfaces import RequiredMissing
    5628from waeup.kofa.interfaces import MessageFactory as _
    5729
Note: See TracChangeset for help on using the changeset viewer.