Ejemplo n.º 1
0
class ITemplate(Interface):
    name = schema.TextLine(title=u"Template name", min_length=2)
    base_type = schema.Choice(title=u"Template type",
                              values=(u'xen', u'kvm', u'openvz'))

    cores = schema.Tuple(
        title=u"Number of virtual cores",
        description=u"Minimum, suggested and maximum number of cores",
        value_type=schema.Int(),
        required=False)
    memory = schema.Tuple(
        title=u"Memory size",
        description=u"Minimum, suggested and maximum memory size (in GB)",
        value_type=schema.Float(),
        required=False)
    swap = schema.Tuple(
        title=u"Memory size",
        description=u"Minimum, suggested and maximum memory size (in GB)",
        value_type=schema.Float(),
        required=False)
    disk = schema.Tuple(
        title=u"Disk size",
        description=u"Minimum, suggested and maximum disk size",
        value_type=schema.Float(),
        required=False)
    cpu_limit = schema.Tuple(
        title=u"CPU usage limits",
        description=u"Minimum, suggested and maximum cpu_limit",
        value_type=schema.Int(),
        required=False)

    username = schema.TextLine(title=u"Default username", required=False)
    password = schema.TextLine(title=u"Default password", required=False)
    ip = schema.TextLine(title=u"Default IP", required=False)
    nameserver = schema.TextLine(title=u"Default nameserver", required=False)
Ejemplo n.º 2
0
class IElasticSettings(Interface):

    hosts = schema.List(title=u'Hosts',
                        default=[u'127.0.0.1'],
                        unique=True,
                        value_type=schema.TextLine(title=u'Host'))

    enabled = schema.Bool(title=u'Enabled', default=False)

    es_only_indexes = schema.Set(
        title=u'Indexes for which all searches are done through ElasticSearch',
        default={'Title', 'Description', 'SearchableText'},
        value_type=schema.TextLine(title=u'Index'),
    )

    sniff_on_start = schema.Bool(title=u'Sniff on start', default=False)

    sniff_on_connection_fail = schema.Bool(title=u'Sniff on connection fail',
                                           default=False)

    sniffer_timeout = schema.Float(title=u'Sniffer timeout',
                                   required=False,
                                   default=None)

    retry_on_timeout = schema.Bool(title=u'Retry on timeout', default=True)

    timeout = schema.Float(
        title=u'Read timeout',
        description=u'how long before timeout connecting to elastic search',
        default=2.0)

    bulk_size = schema.Int(title=u'Bulk Size',
                           description=u'bulk size for elastic queries',
                           default=50)
Ejemplo n.º 3
0
class ITokenBucket(interface.Interface):
    """
    A token bucket is used in rate limiting applications.
    It has a maximum capacity and a rate at which tokens are regenerated
    (typically this is in terms of absolute time).

    Clients attempt to consume tokens and are either allowed
    or denied based on whether there are enough tokens in the bucket.
    """

    fill_rate = schema.Float(
        title=u"The rate in tokens per second at which new tokens arrive.",
        default=1.0,
        min=0.0)
    capacity = schema.Float(title=u"The maximum capacity of the token bucket.",
                            min=0.0)

    tokens = schema.Float(
        title=u"The current number of tokens in the bucket at this instant.",
        min=0.0)

    def consume(tokens=1):
        """
        Consume tokens from the bucket.

        :keyword tokens: The fractional number of tokens to consume. The default
                is to consume one whole token, which is probably what you want.

        :return: True if there were sufficient tokens, otherwise False.
                If True, then the value of `tokens` will have been reduced.
        """

    def wait_for_token():
        """
Ejemplo n.º 4
0
class IStockBehavior(model.Schema):
    """Stock behavior.
    """

    model.fieldset('shop',
                   label=u"Shop",
                   fields=[
                       'item_display_stock', 'item_available', 'item_overbook',
                       'item_stock_warning_threshold'
                   ])

    item_display_stock = schema.Bool(title=_(u'label_item_display_stock',
                                             default=u'Display item stock'),
                                     required=False,
                                     defaultFactory=default_item_display_stock)

    item_available = schema.Float(title=_(u'label_item_available',
                                          default=u'Item stock available'),
                                  required=False)

    item_overbook = schema.Float(title=_(u'label_item_overbook',
                                         default=u'Item stock overbook'),
                                 required=False)

    item_stock_warning_threshold = schema.Float(
        title=_(u'label_item_stock_warning_threshold',
                default=u'Item stock warning threshold.'),
        required=False,
        defaultFactory=default_item_stock_warning_threshold)
Ejemplo n.º 5
0
class IElasticSettings(Interface):

    hosts = schema.List(title=u'Hosts',
                        default=[u'127.0.0.1'],
                        unique=True,
                        value_type=schema.TextLine(title=u'Host'))

    enabled = schema.Bool(title=u'Enabled', default=False)

    sniff_on_start = schema.Bool(title=u'Sniff on start', default=False)

    sniff_on_connection_fail = schema.Bool(title=u'Sniff on connection fail',
                                           default=False)

    sniffer_timeout = schema.Float(title=u'Sniffer timeout', default=0.1)

    retry_on_timeout = schema.Bool(title=u'Retry on timeout', default=True)

    timeout = schema.Float(
        title=u'Read timeout',
        description=u'how long before timeout connecting to elastic search',
        default=2.0)

    auto_flush = schema.Bool(
        title=u'Auto flush',
        description=u'Should indexing operations in elastic search '
        u'be immediately consistent. '
        u'If on, things are always updated immediately at '
        u'a cost of performance.',
        default=True)

    bulk_size = schema.Int(title=u'Bulk Size',
                           description=u'bulk size for elastic queries',
                           default=50)
Ejemplo n.º 6
0
class IAddTag(Interface):
    """
    Form to add a new image tag
    """

    id = schema.TextLine(title=_(u"Id"), required=False)

    field = schema.Choice(
        title=_(u"Image field"),
        description=_(u"Image field you want to add this tag"),
        vocabulary='collective.imagetags.imagefields',
        required=True)

    title = schema.TextLine(title=_(u"Title displayed in the tag"),
                            required=True)

    url = schema.URI(title=_(u"Link for the tag"), required=False)

    x = schema.Float(
        title=_(u"X position"),
        description=_(
            u"Position in the X axis of the center of the box (0-100%)"),
        min=0.0,
        max=100.0)

    y = schema.Float(
        title=_(u"Y position"),
        description=_(
            u"Position in the Y axis of the center of the box (0-100%)"),
        min=0.0,
        max=100.0)
Ejemplo n.º 7
0
class IStudyStatistics(IKnowledgeObject):
    '''Statistician-friendly statistics.'''
    sensitivity = schema.Float(
        title=_(u'Sensitivity'),
        description=_(
            u'Proportion of actual positives that are correctly identified.'),
        required=False)
    specificity = schema.Float(
        title=_(u'Specificity'),
        description=_(
            u'Proportion of actual negatives that are correctly identified.'),
        required=False)
    npv = schema.Float(
        title=_(u'NPV'),
        description=_(
            u'Ratio of true negatives to combined true and false negatives.'),
        required=False)
    ppv = schema.Float(
        title=_(u'PPV'),
        description=_(
            u'Ratio of true positives to combined true and false positives.'),
        required=False)
    prevalence = schema.Float(title=_(u'Prevalence'),
                              description=_(u'A percentage.'),
                              required=False)
    details = schema.TextLine(
        title=_(u'Details'),
        description=_(u'Detailed notes about this set of statistics.'),
        required=False)
    specificAssayType = schema.Text(
        title=_(u'Specific Assay Type'),
        description=_(u'Information about the specific assay type used'),
        required=False)
Ejemplo n.º 8
0
class IDataCollection(Interface):
    """
    Collection of one or more (related) data series and associated metadata.
    Usually the logical component of a chart with multiple data series.
    """

    title = schema.TextLine(
        title=_(u'Title'),
        description=_(u'Data collection name or title; may be displayed '
                      u'in legend.'),
        required=False,
        )

    description = schema.Text(
        title=_(u'Description'),
        description=_(u'Textual description of the data collection.'),
        required=False,
        )

    units = schema.TextLine(
        title=_(u'Units'),
        description=_(u'Common set of units of measure for the data '
                      u'series in this collection.  If the units '
                      u'for series are not shared, then define '
                      u'respective units on the series themselves. '
                      u'May be displayed as part of Y-axis label.'),
        required=False,
        )

    goal = schema.Float(
        title=_(u'Goal'),
        description=_(u'Common goal value as decimal number.  If each '
                      u'series has different respective goals, edit '
                      u'those goals on each series.'),
        required=False,
        )

    range_min = schema.Float(
        title=_(u'Range minimum'),
        description=_(u'Minimum anticipated value of any data point '
                      u'(optional).'),
        required=False,
        )

    range_max = schema.Float(
        title=_(u'Range maximum'),
        description=_(u'Maximum anticipated value of any data point '
                      u'(optional).'),
        required=False,
        )

    def series():
        """
        return a iterable of IDataSeries objects.
        """

    def identities():
        """
Ejemplo n.º 9
0
class IBuyableBehavior(model.Schema, IBuyable):
    """Buyable behavior.
    """

    model.fieldset('shop',
                   label=u"Shop",
                   fields=[
                       'item_net', 'item_vat', 'item_cart_count_limit',
                       'item_display_gross', 'item_comment_enabled',
                       'item_comment_required', 'item_quantity_unit_float',
                       'item_quantity_unit'
                   ])

    item_net = schema.Float(title=_(u'label_item_net',
                                    default=u'Item net price'),
                            required=False,
                            defaultFactory=default_item_net)

    item_vat = schema.Choice(
        title=_(u'label_item_vat', default=u'Item VAT (in %)'),
        vocabulary='bda.plone.shop.vocabularies.VatVocabulary',
        required=False,
        defaultFactory=default_item_vat)

    item_cart_count_limit = schema.Float(
        title=_(u'label_item_cart_count_limit',
                default=u'Max count of this item in cart'),
        required=False,
        defaultFactory=default_item_cart_count_limit)

    item_display_gross = schema.Bool(
        title=_(u'label_item_display_gross', default=u'Display Gross Price'),
        description=_(u'help_item_display_gross',
                      default=u'Show price with taxes included'),
        required=False,
        defaultFactory=default_item_display_gross)

    item_comment_enabled = schema.Bool(title=_(u'label_item_comment_enabled',
                                               default='Comment enabled'),
                                       required=False,
                                       defaultFactory=item_comment_enabled)

    item_comment_required = schema.Bool(
        title=_(u'label_item_comment_required', default='Comment required'),
        required=False,
        defaultFactory=default_item_comment_required)

    item_quantity_unit_float = schema.Bool(
        title=_(u'label_item_quantity_unit_float',
                default='Quantity as float'),
        required=False,
        defaultFactory=default_item_quantity_unit_float)

    item_quantity_unit = schema.Choice(
        title=_(u'label_item_quantity_unit', default='Quantity unit'),
        vocabulary='bda.plone.shop.vocabularies.QuantityUnitVocabulary',
        required=False,
        defaultFactory=default_item_quantity_unit)
Ejemplo n.º 10
0
class IOrder3(interface.Interface):
    identifier = schema.Int(title=u"Identifier", readonly=True)
    name = schema.TextLine(title=u"name")
    min_size = schema.Float(title=u"Minimum size")
    max_size = schema.Float(title=u"Maximum size")
    now = schema.Datetime(title=u'Now', readonly=True)

    @interface.invariant
    def maxGreaterThanMin(order):
        if order.max_size < order.min_size:
            raise interface.Invalid("Maximum is less than minimum")
Ejemplo n.º 11
0
class IAddressRowSchema(model.Schema):
    number = schema.TextLine(title=_(u"N°"), required=False)

    street = schema.TextLine(title=_(u"Street"), required=True)

    zip_code = schema.Int(title=_(u"Zip code"), required=True)

    commune = schema.TextLine(title=_(u"Commune"), required=True)

    longitude = schema.Float(title=_(u"Longitude"), required=False)

    latitude = schema.Float(title=_(u"Latitude"), required=False)
Ejemplo n.º 12
0
class ITransportationexpenses(model.Schema):
    """
    """

    amount_transportation = schema.Float(
        title=_(u'label_applications_amount_transportation', u'Amount for Transportation Expenses'),
        required=True,
        min=0.0,
    )

    directives.widget(transportation_type=CheckBoxFieldWidget)
    transportation_type = schema.Set(
        title=_(u'label_applications_transportation_type', default=u'Type Transportation'),
        value_type=schema.Choice(
            vocabulary='im.applications.TransportationType',
        ),
        required=False,
    )

    directives.read_permission(amount_transportation_recommended='im.applications.ViewComision')
    directives.write_permission(amount_transportation_recommended='im.applications.EditComision')
    amount_transportation_recommended = schema.Float(
        title=_(u'label_applications_amount_transportation_recommended', u'Approved Amount by Special Comision for Transportation Expenses'),
        required=True,
        min=0.0,
    )

    directives.read_permission(amount_transportation_authorized='im.applications.ViewCantidadAutorizada')
    directives.write_permission(amount_transportation_authorized='im.applications.EditConsejo')
    amount_transportation_authorized = schema.Float(
        title=_(u'label_applications_amount_transportation_authorized', u'Approved Amount by Consejo Interno for Transportation Expenses'),
        required=True,
        min=0.0,
    )

    directives.read_permission(amount_transportation_used='im.applications.ViewCantidadUtilizada')
    directives.write_permission(amount_transportation_used='im.applications.EditCantidadUtilizada')
    amount_transportation_used = schema.Float(
        title=_(u'label_applications_amount_transportation_used', u'Used Amount for Transportation Expenses'),
        required=True,
        min=0.0,
    )

    @invariant
    def validateFields(data):
        if data.amount_transportation > 0 and data.transportation_type == set([]):
            message = 'Invalid Transportation Type: You must select at least one transportation, please correct it.'
            raise Invalid(_('label_im_applications_error_transportation', default=message))
        elif data.amount_transportation == 0:
            if data.transportation_type.__contains__('groudtransportation') or data.transportation_type.__contains__('airtransport'):
                message = 'Invalid Transportation Type: You amount transportation is zero the transportation type must be empty, please correct it.'
                raise Invalid(_('label_im_applications_error_transportation2', default=message))
Ejemplo n.º 13
0
class IFloat(interfaces.IFloat, interfaces.IFromUnicode):

    min = schema.Float(
        title=interfaces.IFloat['min'].title,
        required=interfaces.IFloat['min'].required,
        default=interfaces.IFloat['min'].default,
    )

    max = schema.Float(
        title=interfaces.IFloat['max'].title,
        required=interfaces.IFloat['max'].required,
        default=interfaces.IFloat['max'].default,
    )
Ejemplo n.º 14
0
class ILibraryConstruction(model.Schema):

    uuid = schema.TextLine(
        title=_(u"UUID"),
        required=True,
        readonly=False,
    )

    sample_no = schema.TextLine(
        title=_(u"Sample number"),
        required=False,
        readonly=False,
    )

    library_time = schema.Datetime(
        title=_(u"Library construction time"),
        constraint=validate_time,
        required=True,
    )

    library_barcode = schema.TextLine(
        title=_(u"Library barcode"),
        required=False,
    )

    library_concentration = schema.Float(
        title=_(u"Library concentration (NG/UL)"),
        min=0.0,
        required=False,
    )

    library_operator = schema.TextLine(
        title=_(u"Library construction operator"),
        required=False,
    )

    library_kit_no = schema.TextLine(
        title=_(u"Library kit lot number"),
        required=False,
    )

    library_location = schema.TextLine(
        title=_(u"Library location"),
        required=False,
    )

    capture_concentration = schema.Float(
        title=_(u"Post capture concentration (NG/UL)"),
        min=0.0,
        required=False,
    )
Ejemplo n.º 15
0
class IPayPal(form.Schema):

    form.fieldset('paypal',
                  label=_(u'Paypal'),
                  fields=[
                      'paypal_type', 'paypal_email', 'paypal_currency',
                      'paypal_itemname', 'paypal_itemnumber', 'paypal_amount',
                      'paypal_shipping', 'paypal_tax'
                  ])

    paypal_type = schema.Choice(
        title=_(u'Button Type'),
        values=['donation', 'buynow'],
        required=False,
    )

    paypal_email = schema.TextLine(
        title=_(u'Email'),
        required=False,
    )

    paypal_currency = schema.Choice(title=_(u'Currency'),
                                    values=CURRENCIES,
                                    required=False,
                                    default='USD')

    paypal_itemname = schema.TextLine(title=_(u'Item Name / Organization'),
                                      required=False)

    paypal_itemnumber = schema.TextLine(title=_(u'Item Number / Donation ID'),
                                        required=False)

    paypal_amount = schema.Float(
        title=_(u'Amount'),
        description=
        _(u'Enter the amount. Set to -1 to allow user to enter their own amount'
          ),
        required=False,
        default=0.0)

    paypal_shipping = schema.Float(
        title=_(u'Shipping'),
        description=_(u'Enter the shipping amount. Not needed for donation'),
        required=False,
        default=0.0)

    paypal_tax = schema.Float(
        title=_(u'Tax'),
        description=_(u'Enter the tax rate in %. Not needed for donation'),
        required=False,
        default=0.0)
Ejemplo n.º 16
0
class IRealEstate(model.Schema):
    """ Marker interface and Dexterity Python Schema for RealEstate
    """

    # If you want, you can load a xml model created TTW here
    # and customize it in Python:

    # model.load('real_estate.xml')

    # directives.widget(level=RadioFieldWidget)
    sale_or_rent = schema.Choice(
        title=_(u"Sale or rent?"),
        vocabulary=u"collective.realestate.RealEstateFor")
    type = schema.Choice(
        title=_(u"Type of real estate"),
        vocabulary=u"collective.realestate.RealEstateTypes",
    )

    # text = RichText(
    #     title=_(u'Text'),
    #     required=False
    # )

    reference = schema.TextLine(title=_(u"Reference"), required=False)

    persons = schema.Int(title=_(u"Number of person(s)"), required=False)

    rooms = schema.Int(title=_(u"Number of bedroom(s)"), required=False)

    bathrooms = schema.Int(title=_(u"Number of bathroom(s)"), required=False)

    area = schema.Float(title=_(u"Area"),
                        description=_(u"Area in m²"),
                        required=False)

    parking = schema.Bool(title=_(u"Parking"),
                          description=_(u"Is there a free parking"),
                          required=False)

    pets = schema.Bool(title=_(u"Pets"),
                       description=_(u"Are pets authorised?"),
                       required=False)

    price = schema.Float(title=_(u"Price"), required=False)

    new = schema.Bool(title=_(u"New"), required=True, default=False)

    sold = schema.Bool(title=_(u"Sold ?"), required=True, default=False)
Ejemplo n.º 17
0
class ILoginLockoutSettings(Interface):

    max_attempts = schema.Int(
        title=_(u'Max Attempts'),
        description=_(u'Number of unsuccessful logins before account locked'),
        default=3,
        required=True)

    reset_period = schema.Float(
        title=_(u'Reset Period (hours)'),
        description=_(u'Locked accounts are reenabled after this time'),
        default=24.0,
        required=True)

    whitelist_ips = schema.Text(
        title=_(u'Lock logins to IP Ranges'),
        description=
        _(u'List of IP Ranges which Client IP must be in to login. Empty disables'
          ),
        default=u'',
        required=False)

    fake_client_ip = schema.Bool(
        title=_(u'Fake Client IP'),
        description=_(u'Ignore X-Forward-For and REMOTE_ADDR headers'),
        default=False,
        required=False)
Ejemplo n.º 18
0
class IShippingBehavior(model.Schema):
    """Shipping behavior.
    """

    model.fieldset('shop',
                   label=u"Shop",
                   fields=[
                       'shipping_item_shippable', 'shipping_item_weight',
                       'shipping_item_free_shipping'
                   ])

    shipping_item_shippable = schema.Bool(
        title=_(u'label_shipping_item_shippable', default=u'Item Shippable'),
        description=_('help_shipping_item_shippable',
                      default=u'Flag whether item is shippable, i.e. '
                      u'downloads are not'),
        defaultFactory=default_shipping_item_shippable)

    shipping_item_weight = schema.Float(title=_(u'label_shipping_item_weight',
                                                default=u'Item Weight'),
                                        required=False)

    shipping_item_free_shipping = schema.Bool(
        title=_(u'label_shipping_item_free_shipping',
                default=u'Free Shipping'),
        description=_('help_shipping_item_free_shipping',
                      default=u'Flag whether shipping of this item is free.'))
Ejemplo n.º 19
0
class IItem(interface.Interface):
    product_id = schema.Int(title=u'ID of the product', required=True)
    product_name = schema.ASCIILine(title=u'Name of the product',
                                    required=True)
    amount = schema.Int(title=u'Amount of products order', required=True)
    unit_price = schema.Float(title=u'Price of a single unit of the order',
                              required=True)
Ejemplo n.º 20
0
class IDataPoint(IAggregateDescription):
    """Data point contains single value and optional note and URI"""

    value = schema.Float(
        title=_(u'Number value'),
        description=_(u'Decimal number value.'),
        default=0.0,
    )

    note = schema.Text(
        title=_(u'Note'),
        description=_(u'Note annotating the data value for this point.'),
        required=False,
    )

    uri = schema.BytesLine(
        title=_(u'URI'),
        description=_(u'URI/URL or identifier to source of data'),
        required=False,
    )

    sample_size = schema.Int(
        title=_(u'Sample size (N)'),
        description=u'Sample size, may be computed denominator of a '
        u'population or subpopulation sampled.',
        required=False,
    )

    def identity():
        """
Ejemplo n.º 21
0
class IProjectionSchema(Interface):
    """Schema used for the datagrid field 'projection' of IProject"""

    service = schema.TextLine(
        title=_(u"Budget Service"),
        required=True,
    )
    btype = schema.TextLine(
        title=_(u"Budget Type"),
        required=True,
    )
    group = schema.TextLine(
        title=_(u"Budget Group"),
        # description=_(u"Define the budget article."),
        required=True,
    )
    title = schema.TextLine(
        title=_(u"Budget Title"),
        # description=_(u"Define the budget article."),
        required=True,
    )
    year = schema.Choice(
        title=_(u"Year"),
        # description=_(u"Choose a year."),
        vocabulary=u"imio.project.core.content.project.year_vocabulary",
        required=True,
        defaultFactory=default_year,
    )
    amount = schema.Float(title=_("Amount"), required=True, default=0.0)
Ejemplo n.º 22
0
class ILogSettings(Interface):
    """A utility used to set log system 's  timeout and max limit.
    """

    timeout = schema.Int(
        title=_(u"timeout"),
        description=_(u"how many days that log at least will be reserved"),
        default=180,
        required=False,
    )
    max = schema.Int(
        title=_(u"max recorders"),
        description=_(u"How many recorders that log at least will be reserved"
                      " before the log dumped."),
        default=10000,
        required=False,
    )
    percentage = schema.Float(
        title=_(u"Percentage"),
        description=_(
            u"when log numbers reach at some Percentage,send warning message"),
        default=0.9,
        required=False,
    )
    bsize = schema.Int(
        title=_(u"batch size"),
        description=_(
            u"How many log recorders will be deleted when every log dumped"),
        default=2000,
        required=False,
    )
Ejemplo n.º 23
0
class ITest(ITestBase):

    long_text = schema.Text(title=u"Long Text", default=u"Lorem Ipsum")
    ascii = schema.ASCIILine(title=u"ASCII", default="1234-abc")
    number1 = schema.Int(title=u"An int", default=24)
    number2 = schema.Float(title=u"An float", default=11.2)
    tf = schema.Bool(title=u"True or False", default=True)
    list_of = schema.List(title=u"A list",
                          value_type=schema.TextLine(),
                          default=['aaa', 'bbb'])
    tuple_of = schema.Tuple(title=u"A tuple",
                            value_type=schema.TextLine(),
                            default=(u'aaa', u'bbb'))
    tuple_of_2 = schema.Tuple(title=u"A tuple",
                              value_type=schema.ASCIILine(),
                              default=('ccc', 'ddd'))
    choose = schema.Choice(
        title=u"Choose",
        values=[1, 2, 3],
        default=1,
    )
    multiple_choice = schema.Tuple(title=u"Multiple choice",
                                   default=(1, 3),
                                   value_type=schema.Choice(values=(1, 2, 3,
                                                                    4)))
    unknown_type = schema.Tuple(title=u"A set of unknown",
                                value_type=TestPersistentObject(
                                    IUnknown, title=u"A persistent something"),
                                default=(Unknown(), ),
                                missing_value=())
Ejemplo n.º 24
0
class IErgebnisdaten(model.Schema):
    """ Marker interface and Dexterity Python Schema for Ergebnisdaten
    """

    maschnr = schema.TextLine(title=u"Maschinen-Nummer", required=False)

    hersteller = schema.TextLine(title=u"Hersteller der Maschine",
                                 required=False)

    fragebogen = schema.TextLine(title=u"ID des Frageboges", required=True)

    fortschritt = schema.Float(title=u"Fortschritt des Fragebogens",
                               required=False)

    notizen = schema.Dict(
        title=u"Notizen des Fragebogens",
        required=False,
        key_type=schema.TextLine(),
        value_type=schema.Text(),
    )

    history = schema.List(title=u"Historie der aufgerufenen Fragen",
                          required=True,
                          value_type=schema.TextLine())

    daten = schema.Dict(title=u"Daten des Fragebogens",
                        required=False,
                        key_type=schema.TextLine(),
                        value_type=schema.Dict(key_type=schema.TextLine(),
                                               value_type=schema.TextLine()))
Ejemplo n.º 25
0
class IOrder(interface.Interface):
    created_on = schema.Datetime(title=u'Creation datetime of order',
                                 required=True)
    total_price = schema.Float(title=u'Total price of the order',
                               required=True)
    item_list = schema.List(title=u'List of items',
                            value_type=schema.Object(IItem))
Ejemplo n.º 26
0
class IMeasureUnits(form.Schema):
    """Modifiers for computed value: units, multiplier, rounding rules"""

    form.widget(value_type=RadioFieldWidget)
    value_type = schema.Choice(
        title=u'Kind of value',
        description=u'What are the basic units of measure?',
        vocabulary=VALUE_TYPE_CHOICES,
        required=True,
    )

    multiplier = schema.Float(
        title=u'Value multiplier constant',
        description=u'What constant numeric (whole or decimal number) '
        u'should the raw computed value be multiplied by?  For '
        u'percentages computed with both a numerator and '
        u'denominator, enter 100.',
        default=1.0,
    )

    units = schema.TextLine(
        title=u'Units of measure',
        description=u'Label for units of measure (optional).',
        required=False,
    )
Ejemplo n.º 27
0
class IPaymentTextSettings(model.Schema):
    # XXX: rename to IPaymentSettings

    model.fieldset(
        "payment",
        label=_(u"Payment", default=u"Payment"),
        fields=[
            "available_payment_methods",
            "payment_method",
            "skip_payment_if_order_contains_reservations",
            "payment_text",
            "cash_on_delivery_costs",
        ],
    )

    available_payment_methods = schema.List(
        title=_(u"label_available_payment_methods",
                default=u"Available Payment Methods"),
        description=_(
            u"help_available_payment_methods",
            default=u"Available payment methods in checkout",
        ),
        required=True,
        min_length=1,
        value_type=schema.Choice(vocabulary="bda.plone.shop.vocabularies."
                                 "AvailablePaymentMethodsVocabulary"),
    )

    payment_method = schema.Choice(
        title=_(u"label_payment_method", default=u"Payment Method"),
        description=_(u"help_payment_method",
                      default=u"Default payment method in checkout"),
        vocabulary="bda.plone.shop.vocabularies."
        "PaymentMethodsVocabulary",
    )

    skip_payment_if_order_contains_reservations = schema.Bool(
        title=_(
            u"label_skip_payment_if_order_contains_reservations",
            default=u"Skip Payment if order contains reservations",
        ),
        required=False,
    )

    widget("payment_text", DataGridFieldFactory)
    payment_text = schema.List(
        title=_(u"label_payment_text", default=u"Payment Texts"),
        value_type=DictRow(
            title=_(u"payment_text", default="Payment Text"),
            schema=ILanguageAndPaymentAwareTextRow,
        ),
        required=False,
    )

    cash_on_delivery_costs = schema.Float(
        title=_(u"label_cash_on_delivery_costs",
                default=u"Cash on delivery costs in gross"),
        required=False,
    )
Ejemplo n.º 28
0
class IRegistrationfees(model.Schema):
    """
    """

    amount_registration = schema.Float(
        title=_(u'label_applications_amount_registration',
                u'Amount for Registration Fees'),
        required=True,
        min=0.0,
    )

    directives.read_permission(
        amount_registration_recommended='im.applications.ViewComision')
    directives.write_permission(
        amount_registration_recommended='im.applications.EditComision')
    amount_registration_recommended = schema.Float(
        title=_(u'label_applications_amount_registration_recommended',
                u'Approved Amount by Special Comision for Registration Fees'),
        required=True,
        min=0.0,
    )

    directives.read_permission(
        amount_registration_authorized='im.applications.ViewCantidadAutorizada'
    )
    directives.write_permission(
        amount_registration_authorized='im.applications.EditConsejo')
    amount_registration_authorized = schema.Float(
        title=_(u'label_applications_amount_registration_authorized',
                u'Approved Amount by Consejo Interno for Registration Fees'),
        required=True,
        min=0.0,
    )

    directives.read_permission(
        amount_registration_used='im.applications.ViewCantidadUtilizada')
    directives.write_permission(
        amount_registration_used='im.applications.EditCantidadUtilizada')
    amount_registration_used = schema.Float(
        title=_(u'label_applications_amount_registration_used',
                u'Used Amount for Registration Fees'),
        required=True,
        min=0.0,
    )
Ejemplo n.º 29
0
class IProduct(model.Schema):
    """Marker for content that can be purchased."""

    product_category = schema.Choice(
        title=u'Product Category',
        required=False,
        vocabulary='jazkarta.shop.product_categories',
    )

    price = Currency(
        title=u'Unit Price',
        default=Decimal("0.00"),
        min=Decimal("0.00"),
    )

    stock_level = schema.Int(
        title=u'Stock Level',
        description=u'Number of items remaining in warehouse. '
        u'Leave blank for no limit.',
        required=False,
        min=0,
    )

    taxable = schema.Bool(
        title=u'Taxable?',
        description=u'Mark the box if this product is subject to sales tax.',
        default=True,
    )

    weight = schema.Float(
        title=u'Weight (lbs)',
        description=u'Used to calculate shipping.',
        required=False,
    )

    recommended_products = RelationList(
        title=u'Recommended products',
        description=
        u'Recommendations to users who bought this product, shown during checkout.',
        default=[],
        required=False,
        value_type=schema.Choice(source=CatalogSource(
            object_provides='jazkarta.shop.interfaces.IProduct'), ))

    model.fieldset(
        'shop',
        label=u"Shop",
        fields=(
            'product_category',
            'price',
            'stock_level',
            'taxable',
            'weight',
            'recommended_products',
        ),
    )
Ejemplo n.º 30
0
class ILerneinheit(model.Schema):
    """ Marker interface for Lerneinheit
    """

    effort = schema.Float(title=u"Zeitbedarf für diese Lerneinheit in Stunden",
                          required=True)

    goals = RichText(title=u"Lernziel der Einheit",
                     description=u"Kurze Beschreibung welches Lernziel mit dieser Einzeit erreicht werden soll.",
                     required=False)