Ignore:
Timestamp:
22 Jan 2015, 19:50:49 (10 years ago)
Author:
Henrik Bettermann
Message:

Use IkobaSourceOrderedMultiSelectWidget? for categories_practice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/ikobacustom.pcn/trunk/src/ikobacustom/pcn/customers/interfaces.py

    r12501 r12508  
    1919from zope import schema
    2020from datetime import datetime
     21from zc.sourcefactory.basic import BasicSourceFactory
    2122from waeup.ikoba.interfaces import IIkobaObject
    2223from waeup.ikoba.customers.interfaces import (
     
    3435    return range(curr_year - 2, curr_year + 5)
    3536
     37class PracticeSource(BasicSourceFactory):
     38    """A source for categories of practice.
     39    """
     40    def getValues(self):
     41        return [
     42            'academic',
     43            'administrative',
     44            'distribution',
     45            'importation',
     46            'manufacturing',
     47            'retail and dispensing',
     48            'wholesale',
     49            ]
     50
     51
    3652class IPCNCustomer(ICustomer):
    3753    """Representation of a customer.
     
    110126        )
    111127
    112     category_practice = schema.TextLine(
    113         title = _(u'Category of Practice'),
    114         description = _(u'academic, retail and dispensing, hospital, administrative, wholesale, importation, manufacturing, etc.'),
    115         required = False,
     128    categories_practice = schema.List(
     129        title = _(u'Categories of Practice'),
     130        value_type = schema.Choice(source=PracticeSource()),
     131        required = False,
     132        default = [],
    116133        )
    117134
     
    129146
    130147class IRONContractOfficialUse(IIkobaObject):
    131     """Interface for editing ROP data by customers.
     148    """Interface for editing RON official use data.
    132149
    133150    """
     
    173190        )
    174191
    175     category_practice = schema.TextLine(
    176         title = _(u'Category of Practice'),
    177         description = _(u'retail and dispensing, wholesale, importation, manufacturing, distribution etc.'),
    178         required = False,
     192    categories_practice = schema.List(
     193        title = _(u'Categories of Practice'),
     194        value_type = schema.Choice(source=PracticeSource()),
     195        required = False,
     196        default = [],
    179197        )
    180198
    181199    premises_certificate = schema.TextLine(
    182200        title = _(u'Last Premises Certificate'),
    183         description= _('If an old premises. state the last premises certificate number issued with date.'),
     201        description= _('If an old premises, state the last premises certificate number issued with date.'),
    184202        required = False,
    185203        )
     
    232250
    233251class IROPContractOfficialUse(IIkobaObject):
    234     """Interface for editing ROP data by customers.
     252    """Interface for editing ROP official use data.
    235253
    236254    """
Note: See TracChangeset for help on using the changeset viewer.