コード例 #1
0
ファイル: interfaces.py プロジェクト: seanchen/plonexp
class ITimesheetForm(Interface):

    when = Datetime(title=u'When',
                    required=True,
                    description=u'Please specify when the work is done',
                    readonly=False)

    who = Choice(
        title=u'Who',
        required=False,
        description=u'Please select who did the work, default is current user',
        values=['abc', 'cde'],
        readonly=False)

    description = Text(
        title=u'Work Description',
        required=True,
        description=
        u'Please provide brief description about what bas been done.',
        readonly=False)

    duration = Float(
        title=u'Duration (Hours)',
        required=True,
        description=u'Please specify how much time you spent on this work.',
        readonly=False)

    percentage = Float(
        title=u'Story Finish Percentage',
        required=False,
        description=u'Please specify the finish percentage for this story.',
        readonly=False)
コード例 #2
0
class IFloatTest(Interface):

    f1 = Float(required=False, min=1.1, max=10.1)

    f2 = Float(required=False)

    f3 = Choice(required=True,
                values=(0.0, 1.1, 2.1, 3.1, 5.1, 7.1, 11.1),
                missing_value=0)
コード例 #3
0
ファイル: test_interfaces.py プロジェクト: kkdhanesh/NBADEMO
 def test_w_fields(self):
     from zope.schema import Text
     from zope.schema import Bytes
     from zope.schema import Int
     from zope.schema import Float
     from zope.schema import Decimal
     self.assertEqual(self._callFUT([Text()]), True)
     self.assertEqual(self._callFUT([Bytes()]), True)
     self.assertEqual(self._callFUT([Int()]), True)
     self.assertEqual(self._callFUT([Float()]), True)
     self.assertEqual(self._callFUT([Decimal()]), True)
     self.assertEqual(self._callFUT(
                          [Text(), Bytes(), Int(), Float(), Decimal()]),
                      True)
コード例 #4
0
class IGeoLocation(Interface):
    """ geographic location cordinates
    """

    latitude = Float(
        title=u"Latitude",
        description=u"",
        required=False,
    )

    longitude = Float(
        title=u"Longitude",
        description=u"",
        required=False,
    )
コード例 #5
0
class IJobInfo(Interface):
    """Job interface"""

    id = TextLine(title="Job ID")

    next_run_time = Float(title="Job next run time")

    job_state = Bytes(title="Job state")
コード例 #6
0
ファイル: interfaces.py プロジェクト: zjs2k/contentratings
class IEditorialRating(Interface):
    """Set a single global rating.
    """

    rating = Float(title=_(u"Rating"),
                   description=_(u"The rating of the current object"),
                   required=False)

    scale = Attribute("Deprecated restriction on the maximum value")
コード例 #7
0
class IHasLocation(Interface):
    """An interface supported by objects with a defined location."""

    latitude = exported(
        doNotSnapshot(
            Float(title=_("The latitude of this object."),
                  required=False, readonly=True)),
        ('devel', dict(exported=False)),
        exported=True)
    longitude = exported(
        doNotSnapshot(
            Float(title=_("The longitude of this object."),
                  required=False, readonly=True)),
        ('devel', dict(exported=False)),
        exported=True)
    time_zone = exported(doNotSnapshot(
        Choice(title=_('The time zone of this object.'),
               required=False, readonly=True,
               vocabulary='TimezoneName')))
コード例 #8
0
ファイル: test_interfaces.py プロジェクト: kkdhanesh/NBADEMO
 def test_w_mixed(self):
     from zope.schema import Text
     from zope.schema import Bytes
     from zope.schema import Int
     from zope.schema import Float
     from zope.schema import Decimal
     self.assertEqual(self._callFUT([Text(), 0]), False)
     self.assertEqual(self._callFUT(
                          [Text(), Bytes(), Int(), Float(), Decimal(), 0]),
                      False)
コード例 #9
0
class ISketch(form.Schema):
    """A Fritzing Sketch file
    """
    
    orderItem = NamedBlobFile(
        title = _(u"Sketch file"),
        description = _(u"The .fzz file of your sketch"))
    
    copies = Int(
        title = _(u"Copies"),
        description = _(u"The more copies, the cheaper each one gets"),
        min = 1,
        default = 1)
    
    form.omitted('check')
    check = Bool(
        title = _(u"File Check"),
        description = _(u"Have us check your design for an extra 4 EUR"),
        default = True)
    
    form.omitted(
        'width', 
        'height', 
        'area')
    
    width = Float(
        title = _(u"Width"),
        description = _(u"The width of this sketch in cm"),
        min = 0.0,
        default = 0.0)
    
    height = Float(
        title = _(u"Height"),
        description = _(u"The height of this sketch in cm"),
        min = 0.0,
        default = 0.0)
    
    area = Float(
        title = _(u"Area"),
        description = _(u"The area of this sketch in cm^2"),
        min = 0.0,
        default = 0.0)
コード例 #10
0
class IDonation(interface.Interface):
    """
    A marker interface for a user donation
    to someone's wishlist.
    """

    userid = Text(title="User that donated.", required=True)

    amount = Float(title="Amount donated", required=True)

    token = Text(title="Charge token", required=True)
コード例 #11
0
 def test_w_normal_fields(self):
     from zope.schema import Text
     from zope.schema import Bytes
     from zope.schema import Int
     from zope.schema import Float
     from zope.schema import Decimal
     self.assertEqual(self._callFUT(Text()), True)
     self.assertEqual(self._callFUT(Bytes()), True)
     self.assertEqual(self._callFUT(Int()), True)
     self.assertEqual(self._callFUT(Float()), True)
     self.assertEqual(self._callFUT(Decimal()), True)
コード例 #12
0
class ITaskHistory(Interface):
    """Scheduler task history item interface"""

    containers(ITaskHistoryContainer)

    status = TextLine(title=_("Execution status"))

    date = Datetime(title=_("Execution start date"), required=True)

    duration = Float(title=_("Execution duration"), required=True)

    report = Text(title=_("Execution report"), required=True)
コード例 #13
0
class IProduct(interface.Interface):
    """
    A product mapped within the system.
    """
    hamid = Text(title="Ham assigned ID", required=True)

    title = Text(title="Product Title", required=True)

    imageURL = Text(title="URL to product image", required=False, default=None)

    itemURL = Text(title="URL to product page", required=True)

    price = Float(title="Product Price", required=True)
コード例 #14
0
ファイル: id.py プロジェクト: talkara/collective.cropimage
class IID(Interface):

    id = TextLine(title=_(u'ID'), )

    ratio_width = Float(
        title=_(u'Ratio Width'),
        description=_(
            u'Keep this field 0.0 if you do not need to set width/height ratio.'
        ),
        default=0.0,
    )

    ratio_height = Float(
        title=_(u'Ratio Height'),
        description=_(
            u'Keep this field 0.0 if you do not need to set width/height ratio.'
        ),
        default=0.0,
    )

    min_width = Float(
        title=_(u'Minimum Width'),
        description=_(
            u'Keep this field 0.0 if you do not need to set minimum width.'),
        default=0.0,
    )

    min_height = Float(
        title=_(u'Minimum Height'),
        description=_(
            u'Keep this field 0.0 if you do not need to set minimum height.'),
        default=0.0,
    )

    max_width = Float(
        title=_(u'Maximum Width'),
        description=_(
            u'Keep this field 0.0 if you do not need to set maximum width.'),
        default=0.0,
    )

    max_height = Float(
        title=_(u'Maximum Height'),
        description=_(
            u'Keep this field 0.0 if you do not need to set maximum height.'),
        default=0.0,
    )
コード例 #15
0
class ISolrSchema(Interface):

    active = Bool(
        title=_("label_active", default=u"Active"),
        description=_(
            "help_active",
            default=u"Check this to enable the Solr integration, i.e. "
            u"indexing and searching using the below settings.",
        ),
        default=False,
    )

    host = TextLine(
        title=_("label_host", default=u"Host"),
        description=_(
            "help_host",
            default=u"The host name of the Solr instance to be used."),
    )

    port = Int(
        title=_("label_port", default=u"Port"),
        description=_("help_port",
                      default=u"The port of the Solr instance to be used."),
    )

    base = TextLine(
        title=_("label_base", default=u"Base"),
        description=_(
            "help_base",
            default=u"The base prefix of the Solr instance to be used."),
    )

    async_indexing = Bool(
        title=_("label_async", default=u"Asynchronous indexing"),
        default=False,
        description=_(
            "help_async",
            default=u"Check to enable asynchronous indexing operations, "
            u"which will improve Zope response times in return for "
            u"not having the Solr index updated immediately.",
        ),
    )

    auto_commit = Bool(
        title=_("label_auto_commit", default=u"Automatic commit"),
        default=True,
        description=_(
            "help_auto_commit",
            default=u"If enabled each index operation will cause a commit "
            u"to be sent to Solr, which causes it to update its "
            u"index. If you disable this, you need to configure "
            u"commit policies on the Solr server side.",
        ),
    )

    commit_within = Int(
        title=_("label_commit_within", default=u"Commit within"),
        default=0,
        description=_(
            "help_commit_within",
            default=u"Maximum number of milliseconds after which adds "
            u"should be processed by Solr. Defaults to 0, meaning "
            u"immediate commits. Enabling this feature implicitly "
            u"disables automatic commit and you should configure "
            u"commit policies on the Solr server side. Otherwise "
            u"large numbers of deletes without adds will not be "
            u"processed. This feature requires a Solr 1.4 server.",
        ),
    )

    index_timeout = Float(
        title=_("label_index_timeout", default=u"Index timeout"),
        description=_(
            "help_index_timeout",
            default=u"Number of seconds after which an index request will "
            u'time out. Set to "0" to disable timeouts.',
        ),
    )

    search_timeout = Float(
        title=_("label_search_timeout", default=u"Search timeout"),
        description=_(
            "help_search_timeout",
            default=u"Number of seconds after which a search request will "
            u'time out. Set to "0" to disable timeouts.',
        ),
    )

    max_results = Int(
        title=_("label_max_results", default=u"Maximum search results"),
        description=_(
            "help_max_results",
            default=u"Specify the maximum number of matches to be returned "
            u'when searching. Set to "10000000" or some other '
            u"ridiculously large value that is higher than the "
            u"possible number of rows that are expected.",
        ),
        default=1000000,
    )

    required = List(
        title=_("label_required", default=u"Required query parameters"),
        description=_(
            "help_required",
            default=u"Specify required query parameters, one per line. "
            u"Searches will only get dispatched to Solr if any "
            u"of the listed parameters is present in the query. "
            u"Leave empty to dispatch all searches.",
        ),
        value_type=TextLine(),
        default=[],
        missing_value=[],
        required=False,
    )

    search_pattern = Text(
        title=_("label_search_pattern",
                default=u"Pattern for simple search queries"),
        description=_(
            "help_search_pattern",
            default=u"Specify a query pattern used for simple queries "
            u"consisting only of words and numbers, i.e. not "
            u"using any of Solr's advanced query expressions. "
            u"{value} and {base_value} are available in the "
            u"pattern and will be replaced by the search word "
            u"and the search word stripped of wildcard symbols.",
        ),
    )

    facets = List(
        title=_("label_facets", default=u"Default search facets"),
        description=_(
            "help_facets",
            default=u"Specify catalog indexes that should be queried for "
            u"facet information, one per line.",
        ),
        value_type=TextLine(),
        default=[],
        required=False,
    )

    filter_queries = List(
        title=_("label_filter_queries", default=u"Filter query parameters"),
        description=_(
            "help_filter_queries",
            default=u"Specify query parameters for which filter queries "
            u"should be used, one per line.  You can use several "
            u"indices in one filter query separated by space. "
            u"Typical examples are "
            u'"effective expires allowedRolesAndUsers" or '
            u'"review_state portal_type".',
        ),
        value_type=TextLine(),
        default=[],
        required=False,
    )

    slow_query_threshold = Int(
        title=_("label_slow_query_threshold", default=u"Slow query threshold"),
        description=_(
            "help_slow_query_threshold",
            default=u"Specify a threshold (in milliseconds) after which "
            u"queries are considered to be slow causing them to "
            u'be logged. Set to "0" to prevent any logging.',
        ),
        default=0,
    )

    effective_steps = Int(
        title=_("label_effective_steps", default=u"Effective date steps"),
        default=1,
        description=_(
            "help_effective_steps",
            default=u"Specify the effective date steps in seconds. "
            u"Using 900 seconds (15 minutes) means the effective "
            u"date sent to Solr changes every 15 minutes.",
        ),
    )

    exclude_user = Bool(
        title=_("label_exclude_user",
                default=u"Exclude user from allowedRolesAndUsers"),
        description=_(
            "help_exclude_user",
            default=u"Specify whether the user:userid should be excluded "
            u"from allowedRolesAndUsers to improve cacheability "
            u"on the expense of finding content with local roles"
            u"given to specific users.",
        ),
        default=False,
    )

    highlight_fields = List(
        title=_("label_highlight_fields", u"Highlighting fields"),
        description=_(
            "help_highlight_fields",
            default=(u"Fields that should be used for highlighting. "
                     u"Snippets of text will be generated from the contents "
                     u"of these fields, with the search keywords that "
                     u"matched highlighted inside the text."),
        ),
        value_type=TextLine(),
        default=[],
        required=False,
    )

    highlight_formatter_pre = TextLine(
        title=_("label_highlight_formatter_pre",
                default=u"Highlight formatter: pre"),
        description=_(
            "help_highlight_formatter_pre",
            default=u"The text to insert before the highlighted keyword.",
        ),
        default=u"[",
        required=False,
    )

    highlight_formatter_post = TextLine(
        title=_("label_highlight_formatter_post",
                default=u"Highlight formatter: post"),
        description=_(
            "help_highlight_formatter_post",
            default=u"The text to insert after the highlighted keyword.",
        ),
        default=u"]",
        required=False,
    )

    highlight_fragsize = Int(
        title=_("label_highlight_fragsize",
                default=u"Highlight Fragment Size"),
        description=_(
            "help_highlight_fragsize",
            default=(u"The size, in characters, of the snippets (aka "
                     u"fragments) created by the highlighter."),
        ),
        default=100,
    )

    field_list = List(
        title=_("label_field_list", default=u"Default fields to be returned"),
        description=_(
            "help_field_list",
            default=(u"Specify metadata fields that should be returned for "
                     u"items in the result set, one per line. Defaults to "
                     u"all available plus ranking score."),
        ),
        value_type=TextLine(),
        default=[],
        required=False,
    )

    levenshtein_distance = Float(
        title=_("label_levenshtein_distance", default=u"Levenshtein distance"),
        description=_(
            "help_levenshtein_distance",
            default=u"The Levenshtein distance is a string metric for "
            u"measuring the difference between two strings. It allows"
            u"you to perform fuzzy searches by specifying a value "
            u"between 0 and 1.",
        ),
        required=False,
        default=0.0,
    )

    atomic_updates = Bool(
        title=_("label_atomic_updates", default=u"Enable atomic updates"),
        description=_(
            "help_atomic_updates",
            default=u"Atomic updates allows you to update only specific "
            u'indexes, like "reindexObject(idxs=["portal_type"])".'
            u"Unfortunately atomic updates are not compatible with "
            u"index time boosting. If you enable atomic updates, "
            u"index time boosting no longer works.",
        ),
        default=True,
        required=False,
    )

    boost_script = Text(
        title=_("label_boost_script",
                default=u"Python script for custom index boosting"),
        required=False,
        default=u"",
        missing_value=u"",
        description=_(
            "help_boost_script",
            default=u"This script is meant to be customized according to "
            u"site-specific search requirements, e.g. boosting "
            u'certain content types like "news items", ranking older '
            u"content lower, consider special important content items,"
            u" content rating etc."
            u" the indexing data that will be sent to Solr is passed "
            u"in as the `data` parameter, the indexable object is "
            u"available via the `context` binding. The return value "
            u"should be a dictionary consisting of field names and "
            u"their respecitive boost values.  use an empty string "
            u"as the key to set a boost value for the entire "
            u"document/content item.",
        ),
    )
コード例 #16
0
 class I(interface.Interface):
     ivar = Float(required=True)  # a plain _type is allowed
コード例 #17
0
class ISolrSchema(Interface):

    active = Bool(
        title=_('label_active', default=u'Active'),
        description=_(
            'help_active',
            default=u'Check this to enable the Solr integration, i.e. '
                    u'indexing and searching using the below settings.'
        ),
        default=False,
    )

    host = TextLine(
        title=_('label_host', default=u'Host'),
        description=_(
            'help_host',
            default=u'The host name of the Solr instance to be used.'
        )
    )

    port = Int(
        title=_('label_port', default=u'Port'),
        description=_(
            'help_port',
            default=u'The port of the Solr instance to be used.'
        )
    )

    base = TextLine(
        title=_('label_base', default=u'Base'),
        description=_(
            'help_base',
            default=u'The base prefix of the Solr instance to be used.'
        )
    )

    async = Bool(
        title=_('label_async', default=u'Asynchronous indexing'),
        default=False,
        description=_(
            'help_async',
            default=u'Check to enable asynchronous indexing operations, '
                    u'which will improve Zope response times in return for '
                    u'not having the Solr index updated immediately.'
        )
    )

    auto_commit = Bool(
        title=_('label_auto_commit', default=u'Automatic commit'),
        default=True,
        description=_(
            'help_auto_commit',
            default=u'If enabled each index operation will cause a commit '
                    u'to be sent to Solr, which causes it to update its '
                    u'index. If you disable this, you need to configure '
                    u'commit policies on the Solr server side.'
        )
    )

    commit_within = Int(
        title=_('label_commit_within', default=u'Commit within'),
        default=0,
        description=_(
            'help_commit_within',
            default=u'Maximum number of milliseconds after which adds '
                    u'should be processed by Solr. Defaults to 0, meaning '
                    u'immediate commits. Enabling this feature implicitly '
                    u'disables automatic commit and you should configure '
                    u'commit policies on the Solr server side. Otherwise '
                    u'large numbers of deletes without adds will not be '
                    u'processed. This feature requires a Solr 1.4 server.'
        )
    )

    index_timeout = Float(
        title=_('label_index_timeout',
                default=u'Index timeout'),
        description=_(
            'help_index_timeout',
            default=u'Number of seconds after which an index request will '
                    u'time out. Set to "0" to disable timeouts.'
        )
    )

    search_timeout = Float(
        title=_('label_search_timeout',
                default=u'Search timeout'),
        description=_(
            'help_search_timeout',
            default=u'Number of seconds after which a search request will '
                    u'time out. Set to "0" to disable timeouts.'
        )
    )

    max_results = Int(
        title=_('label_max_results',
                default=u'Maximum search results'),
        description=_(
            'help_max_results',
            default=u'Specify the maximum number of matches to be returned '
                    u'when searching. Set to "10000000" or some other '
                    u'ridiculously large value that is higher than the '
                    u'possible number of rows that are expected.'
        ),
        default=1000000,
    )

    required = List(
        title=_('label_required', default=u'Required query parameters'),
        description=_(
            'help_required',
            default=u'Specify required query parameters, one per line. '
                    u'Searches will only get dispatched to Solr if any '
                    u'of the listed parameters is present in the query. '
                    u'Leave empty to dispatch all searches.'
        ),
        value_type=TextLine(),
        default=[],
        missing_value=[],
        required=False
    )

    search_pattern = Text(
        title=_('label_search_pattern',
                default=u'Pattern for simple search queries'),
        description=_(
            'help_search_pattern',
            default=u'Specify a query pattern used for simple queries '
                    u'consisting only of words and numbers, i.e. not '
                    u'using any of Solr\'s advanced query expressions. '
                    u'{value} and {base_value} are available in the '
                    u'pattern and will be replaced by the search word '
                    u'and the search word stripped of wildcard symbols.'
        )
    )

    facets = List(
        title=_('label_facets', default=u'Default search facets'),
        description=_(
            'help_facets',
            default=u'Specify catalog indexes that should be queried for '
                    u'facet information, one per line.'),
        value_type=TextLine(),
        default=[],
        required=False
    )

    filter_queries = List(
        title=_('label_filter_queries', default=u'Filter query parameters'),
        description=_(
            'help_filter_queries',
            default=u'Specify query parameters for which filter queries '
                    u'should be used, one per line.  You can use several '
                    u'indices in one filter query separated by space. '
                    u'Typical examples are '
                    u'"effective expires allowedRolesAndUsers" or '
                    u'"review_state portal_type".'
        ),
        value_type=TextLine(),
        default=[],
        required=False
    )

    slow_query_threshold = Int(
        title=_('label_slow_query_threshold',
                default=u'Slow query threshold'),
        description=_(
            'help_slow_query_threshold',
            default=u'Specify a threshold (in milliseconds) after which '
                    u'queries are considered to be slow causing them to '
                    u'be logged. Set to "0" to prevent any logging.'
        ),
        default=0,
    )

    effective_steps = Int(
        title=_('label_effective_steps',
                default=u'Effective date steps'),
        default=1,
        description=_(
            'help_effective_steps',
            default=u'Specify the effective date steps in seconds. '
                    u'Using 900 seconds (15 minutes) means the effective '
                    u'date sent to Solr changes every 15 minutes.'))

    exclude_user = Bool(
        title=_('label_exclude_user',
                default=u'Exclude user from allowedRolesAndUsers'),
        description=_(
            'help_exclude_user',
            default=u'Specify whether the user:userid should be excluded '
                    u'from allowedRolesAndUsers to improve cacheability '
                    u'on the expense of finding content with local roles'
                    u'given to specific users.'),
        default=False
    )

    highlight_fields = List(
        title=_(u'Highlighting fields'),
        description=_(
            u'Fields that should be used for highlighting. '
            u'Snippets of text will be generated from the contents '
            u' of these fields, with the search keywords that'
            u'matched highlighted inside the text.'
        ),
        value_type=TextLine(),
        default=[],
        required=False
    )

    highlight_formatter_pre = TextLine(
        title=_(u'Highlight formatter: pre'),
        description=_(u'The text to insert before the highlighted keyword.'),
        default=u'[', required=False
    )

    highlight_formatter_post = TextLine(
        title=_(u'Highlight formatter: post'),
        description=_(u'The text to insert after the highlighted keyword.'),
        default=u']',
        required=False
    )

    highlight_fragsize = Int(
        title=_(u'Highlight Fragment Size'), default=100,
        description=_(
            u'The size, in characters, of the snippets (aka '
            U'fragments) created by the highlighter.'
        )
    )

    field_list = List(
        title=_(u'Default fields to be returned'),
        description=_(u'Specify metadata fields that should be returned for '
                      u'items in the result set, one per line. Defaults to '
                      u'all available plus ranking score.'),
        value_type=TextLine(),
        default=[],
        required=False
    )

    levenshtein_distance = Float(
        title=_('label_levenshtein_distance',
                default=u'Levenshtein distance'),
        description=_(
            'help_levenshtein_distance',
            default=u'The Levenshtein distance is a string metric for '
                    u'measuring the difference between two strings. It allows'
                    u'you to perform fuzzy searches by specifying a value '
                    u'between 0 and 1.'
        ),
        required=False,
        default=0.0,
    )

    atomic_updates = Bool(
        title=_('label_atomic_updates',
                default=u'Enable atomic updates'),
        description=_(
            'help_atomic_updates',
            default=u'Atomic updates allows you to update only specific '
                    u'indexes, like "reindexObject(idxs=["portal_type"])".'
                    u'Unfortunately atomic updates are not compatible with '
                    u'index time boosting. If you enable atomic updates, '
                    u'index time boosting no longer works.'),
        default=True,
        required=False,
    )

    boost_script = Text(
        title=_('label_boost_script',
                default=u'Python script for custom index boosting'),
        required=False,
        default=u'',
        missing_value=u'',
        description=_(
            'help_search_pattern',
            default=u'This script is meant to be customized according to '
                    u'site-specific search requirements, e.g. boosting '
                    u'certain content types like "news items", ranking older '
                    u'content lower, consider special important content items,'
                    u' content rating etc.'
                    u' the indexing data that will be sent to Solr is passed '
                    u'in as the `data` parameter, the indexable object is '
                    u'available via the `context` binding. The return value '
                    u'should be a dictionary consisting of field names and '
                    u'their respecitive boost values.  use an empty string '
                    u'as the key to set a boost value for the entire '
                    u'document/content item.'
        )
    )
コード例 #18
0
class IFabOrders(form.Schema):
    """Fritzing Fab orders Folder
    """
    
    title = TextLine(
        title = _(u"Order-folder name"),
        description = _(u"The title of this fab-instance"))
    
    description = Text(
        title = _(u"Order-folder description"),
        description = _(u"The description (also subtitle) of this fab-instance"))
    
    salesEmail = TextLine(
        title = _(u"Sales e-mail"),
        description = _(u"Order status changes are e-mailed to this address"),
        constraint = checkEMail)
    
    shippingGermany = Float(
        title = _(u"Shipping Costs Germany"),
        description = _(u"The shipping costs for Germany in Euro"),
        min = 0.0,
        default = 4.0)
    
    shippingEU = Float(
        title = _(u"Shipping Costs EU"),
        description = _(u"The shipping costs for the EU in Euro"),
        min = 0.0,
        default = 6.0)
    
    shippingWorld = Float(
        title = _(u"Shipping Costs outside EU"),
        description = _(u"The shipping costs for otside of the EU in Euro"),
        min = 0.0,
        default = 6.0)
    
    taxesGermany = Float(
        title = _(u"Taxes Germany"),
        description = _(u"The taxes for Germany in Percent"),
        min = 0.0,
        default = 19.0)
    
    taxesEU = Float(
        title = _(u"Taxes EU"),
        description = _(u"The taxes for the EU in Percent"),
        min = 0.0,
        default = 19.0)
    
    taxesWorld = Float(
        title = _(u"Taxes outside EU"),
        description = _(u"The taxes for outside of the EU in Percent"),
        min = 0.0,
        default = 0.0)
    
    nextProductionDelivery = Date(
        title = _(u"Next production delivery date"),
        description = _(u"Estimated delivery date of PCBs from the next production"),
        required = False)
    
    nextProductionClosingDate = Date(
        title = _(u"Next production closing date"),
        description = _(u"Orders must be send in before this date to be included in the next production run"),
        required = False)
    
    editableContent = RichText(
        title = _(u"Order-folder text"),
        description = _(u"The text of this fab-instance"))
コード例 #19
0
class ILocationField(IField):
    """A location, consisting of geographic coordinates and a time zone."""

    latitude = Float(title=_('Latitude'))
    longitude = Float(title=_('Longitude'))
    time_zone = Choice(title=_('Time zone'), vocabulary='TimezoneName')
コード例 #20
0
class IFabOrder(form.Schema):
    """Fritzing Fab order details
    """
    
    shipTo = Choice(
        title = _(u"Shipping Area"),
        description = _(u"Where you are located"),
        vocabulary = SimpleVocabulary([
            SimpleTerm(value = u'germany', title = _(u'Germany')),
            SimpleTerm(value = u'eu', title = _(u'European Union (EU)')),
            SimpleTerm(value = u'world', title = _(u'Worldwide'))
        ]))
    
    email = TextLine(
        title = _(u"E-Mail"),
        description = _(u"Your e-mail address"),
        constraint = checkEMail)
    
    form.omitted(
        'telephone',
        'area', 
        'pricePerSquareCm', 
        'priceNetto', 
        'priceShipping', 
        'numberOfQualityChecks', 
        'priceQualityChecksNetto', 
        'taxesPercent', 
        'taxes', 
        'priceTotalNetto', 
        'priceTotalBrutto',
        'trackingNumber')
    
    telephone = ASCIILine(
        title = _(u"Telephone number"),
        description = _(u"We prefer a mobile number"))
    
    area = Float(
        title = _(u"Area"),
        description = _(u"The total area of all sketches in cm^2"),
        min = 0.0,
        default = 0.0)
    
    pricePerSquareCm = Float(
        title = _(u"Price per cm^2"),
        description = _(u"The price per cm^2 in Euro"),
        min = 0.0,
        default = 0.0)
    
    priceNetto = Float(
        title = _(u"Netto price"),
        description = _(u"The netto price without shipping in Euro"),
        min = 0.0,
        default = 0.0)
    
    priceShipping = Float(
        title = _(u"Shipping costs"),
        description = _(u"The shipping costs in Euro"),
        min = 0.0,
        default = 0.0)
    
    numberOfQualityChecks = Int(
        title = _(u"Number of quality checks"),
        description = _(u"Number of quality checks"),
        min = 0,
        default = 0)
    
    priceQualityChecksNetto = Float(
        title = _(u"Costs for quality checks"),
        description = _(u"The costs for quality checks in Euro"),
        min = 0.0,
        default = 0.0)
    
    taxesPercent = Float(
        title = _(u"Percent Taxes"),
        description = _(u"Taxes like VAT in Percent"),
        min = 0.0,
        default = 0.0)
    
    taxes = Float(
        title = _(u"Taxes"),
        description = _(u"Taxes like VAT"),
        min = 0.0,
        default = 0.0)
    
    priceTotalNetto = Float(
        title = _(u"Total Netto"),
        description = _(u"The netto price costs in Euro"),
        min = 0.0,
        default = 0.0)
    
    priceTotalBrutto = Float(
        title = _(u"Total"),
        description = _(u"The price including shipping costs and taxes in Euro"),
        min = 0.0,
        default = 0.0)
    
    trackingNumber = TextLine(
        title = _(u"Tracking Number"),
        description = _(u"The tracking number assigned by the parcel service"))
コード例 #21
0
class ISolrSchema(Interface):

    active = Bool(title=_(u'Active'),
                  default=False,
                  description=_(
                      u'Check this to enable the Solr integration, i.e. '
                      'indexing and searching using the below settings.'))

    host = TextLine(
        title=_(u'Host'),
        description=_(u'The host name of the Solr instance to be used.'))

    port = Int(title=_(u'Port'),
               description=_(u'The port of the Solr instance to be used.'))

    base = TextLine(
        title=_(u'Base'),
        description=_(u'The base prefix of the Solr instance to be used.'))

    async = Bool(title=_(u'Asynchronous indexing'),
                 default=False,
                 description=_(
                     u'Check to enable asynchronous indexing operations, '
                     'which will improve Zope response times in return for '
                     'not having the Solr index updated immediately.'))

    auto_commit = Bool(
        title=_(u'Automatic commit'),
        default=True,
        description=_(u'If enabled each index operation will cause a commit '
                      'to be sent to Solr, which causes it to update its '
                      'index. If you disable this, you need to configure '
                      'commit policies on the Solr server side.'))

    commit_within = Int(
        title=_(u'Commit within'),
        default=0,
        description=_(u'Maximum number of milliseconds after which adds '
                      'should be processed by Solr. Defaults to 0, meaning '
                      'immediate commits. Enabling this feature implicitly '
                      'disables automatic commit and you should configure '
                      'commit policies on the Solr server side. Otherwise '
                      'large numbers of deletes without adds will not be '
                      'processed. This feature requires a Solr 1.4 server.'))

    index_timeout = Float(
        title=_(u'Index timeout'),
        description=_(u'Number of seconds after which an index request will '
                      'time out. Set to "0" to disable timeouts.'))

    search_timeout = Float(
        title=_(u'Search timeout'),
        description=_(u'Number of seconds after which a search request will '
                      'time out. Set to "0" to disable timeouts.'))

    max_results = Int(
        title=_(u'Maximum search results'),
        description=_(u'Specify the maximum number of matches to be returned '
                      'when searching. Set to "0" to always return all '
                      'results.'))

    required = List(title=_(u'Required query parameters'),
                    description=_(
                        u'Specify required query parameters, one per line. '
                        'Searches will only get dispatched to Solr if any '
                        'of the listed parameters is present in the query. '
                        'Leave empty to dispatch all searches.'),
                    value_type=TextLine(),
                    default=[],
                    required=False)

    search_pattern = TextLine(
        title=_(u'Pattern for simple search queries'),
        description=_(u'Specify a query pattern used for simple queries '
                      'consisting only of words and numbers, i.e. not '
                      'using any of Solr\'s advanced query expressions. '
                      '{value} and {base_value} are available in the '
                      'pattern and will be replaced by the search word '
                      'and the search word stripped of wildcard symbols.'))

    facets = List(title=_(u'Default search facets'),
                  description=_(
                      u'Specify catalog indexes that should be queried for '
                      'facet information, one per line.'),
                  value_type=TextLine(),
                  default=[],
                  required=False)

    filter_queries = List(
        title=_(u'Filter query parameters'),
        description=_(u'Specify query parameters for which filter queries '
                      'should be used, one per line.  You can use several '
                      'indices in one filter query separated by space. '
                      'Typical examples are '
                      '"effective expires allowedRolesAndUsers" or '
                      '"review_state portal_type".'),
        value_type=TextLine(),
        default=[],
        required=False)

    slow_query_threshold = Int(
        title=_(u'Slow query threshold'),
        description=_(u'Specify a threshold (in milliseconds) after which '
                      'queries are considered to be slow causing them to '
                      'be logged. Set to "0" to prevent any logging.'))

    effective_steps = Int(
        title=_(u'Effective date steps'),
        default=1,
        description=_(u'Specify the effective date steps in seconds. '
                      'Using 900 seconds (15 minutes) means the effective '
                      'date sent to Solr changes every 15 minutes.'))

    exclude_user = Bool(
        title=_(u'Exclude user from allowedRolesAndUsers'),
        description=_(u'Specify whether the user:userid should be excluded '
                      'from allowedRolesAndUsers to improve cacheability '
                      'on the expense of finding content with local roles'
                      'given to specific users.'),
        default=False)

    highlight_fields = List(
        title=_(u'Highlighting fields'),
        description=_(u'Fields that should be used for highlighting. '
                      'Snippets of text will be generated from the contents '
                      ' of these fields, with the search keywords that'
                      'matched highlighted inside the text.'),
        value_type=TextLine(),
        default=[],
        required=False)

    highlight_formatter_pre = TextLine(
        title=_(u'Highlight formatter: pre'),
        description=_(u'The text to insert before the highlighted keyword.'),
        default=u'[',
        required=False)

    highlight_formatter_post = TextLine(
        title=_(u'Highlight formatter: post'),
        description=_(u'The text to insert after the highlighted keyword.'),
        default=u']',
        required=False)

    highlight_fragsize = Int(
        title=_(u'Highlight Fragment Size'),
        default=100,
        description=_(u'The size, in characters, of the snippets (aka '
                      'fragments) created by the highlighter.'))
    field_list = List(
        title=_(u'Default fields to be returned'),
        description=_(u'Specify metadata fields that should be returned for '
                      'items in the result set, one per line. Defaults to '
                      'all available plus ranking score.'),
        value_type=TextLine(),
        default=[],
        required=False)
コード例 #22
0
 class I(interface.Interface):
     ivar = Float()  # a plain _type is allowed
コード例 #23
0
class I(Interface):

    title = Text(description=u("Short summary"), default=u('say something'))
    weight = Float(min=0.0)
    code = Bytes(min_length=6, max_length=6, default=b('xxxxxx'))
    date = Float(title=u('Date'), readonly=True)
コード例 #24
0
ファイル: interfaces.py プロジェクト: mleist/ict-ok.org
class IPhysicalMedia(Interface):
    """A PhysicalMedia object."""

    capacity = PhysicalQuantity(
        title=_(u'Capacity'),
        description=_(
            u"The number of bytes that can be read from or written to a Media."
        ),
        required=False)

    cleanerMedia = Bool(
        title=_(u'Cleaner media'),
        description=
        _(u"Indicating that the PhysicalMedia is used for cleaning purposes and not data storage."
          ),
        required=False)

    dualSided = Bool(
        title=_(u'Dual sided'),
        description=
        _(u"Indicating that the Media has two recording sides (TRUE) or only a single side (FALSE)."
          ),
        required=False)

    maxMounts = Int(
        title=_(u'Max mounts'),
        description=
        _(u"For removable Media, the maximum number of times that the Media can be mounted before it should be retired. For cleaner Media, this is the maximum number of Drive cleans that can be performed. For nonremovable Media, such as hard disks, this property is not applicable and should be set to 0."
          ),
        required=False)

    mediaSize = Float(title=_(u'Media size'),
                      description=_(u"Size of the Media in inches."),
                      required=False)

    mediaType = Choice(
        title=_(u'Media Type'),
        description=_(u"Specifies the type of the PhysicalMedia."),
        required=False,
        vocabulary="PhysicalMediaMediaTypes")

    timeOfLastMount = Datetime(
        title=_(u'Time of last mount'),
        description=
        _(u"For removable or cleaner Media, the date and time that the Media was last mounted. For nonremovable Media, such as hard disks, this property has no meaning and is not applicable."
          ),
        required=False)

    writeProtectOn = Bool(
        title=_(u'Write protect on'),
        description=
        _(u"Specifying whether the Media is currently write protected by some kind of physical mechanism, such as a protect tab on a floppy diskette."
          ),
        required=False)

    labelFormat = Choice(
        title=_(u'Label Format'),
        description=_(
            u"The formats of each of the labels on a PhysicalMedia."),
        required=False,
        vocabulary="PhysicalMediaLabelFormats")

    device = Choice(title=_(u'Device'),
                    vocabulary='AllDevices',
                    required=False)

    @invariant
    def ensureCapacityUnit(physicalMedia):
        if physicalMedia.capacity is not None:
            physicalInput = convertQuantity(physicalMedia.capacity)
            if not physicalInput.isBitUnit():
                raise Invalid(
                    "No capacity specification: '%s'." % \
                    (physicalMedia.capacity))

    def trigger_online():
        """
コード例 #25
0
class ITestOptions(zope.interface.Interface):
    text_id = Text()
    int_id = Int()
    bool_id = Bool()
    float_id = Float()
コード例 #26
0
 class Schema(Interface):
     title = Text(description=u"Short summary", default=u'say something')
     weight = Float(min=0.0)
     code = Bytes(min_length=6, max_length=6, default=b'xxxxxx')
     date = Float(title=u'Date', readonly=True)