Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
True
Unfortunately ftests don't have good isolation from each other yet.
"""
from zope.interface import Interface
from zope import schema
import grok
from grok import index
class Herd(grok.Container, grok.Application):
pass
class IMammoth(Interface):
name = schema.TextLine(title=u'Name')
class IMammoth2(Interface):
name = schema.TextLine(title=u'Name')
class MammothIndexes(grok.Indexes):
grok.site(Herd)
grok.context(IMammoth)
name = index.Field()
class MammothIndexes2(grok.Indexes):
grok.site(Herd)
grok.context(IMammoth2)
name = index.Field()
from zope.interface import implementer
from zope.schema import getFieldsInOrder
import random
class ICollectionTile(IPersistentCoverTile):
header = schema.TextLine(
title=_(u'Header'),
required=False,
)
form.omitted('title')
form.no_omit(IDefaultConfigureForm, 'title')
title = schema.TextLine(
title=_(u'Title'),
required=False,
)
form.omitted('description')
form.no_omit(IDefaultConfigureForm, 'description')
description = schema.Text(
title=_(u'Description'),
required=False,
)
form.omitted('date')
form.no_omit(IDefaultConfigureForm, 'date')
date = schema.Datetime(
title=_(u'Date'),
required=False,
shortTitle = schema.TextLine(
title=_(u"Short Title"),
description=_(u"Short title of the product, which can be displayed in overviews"),
default=u"",
required=False,
)
shortText = schema.TextLine(
title=_(u"Short Text"),
description=_(u"A short text of the product, which can be displayed in overviews"),
default=u"",
required=False,
)
text = schema.TextLine(
title=_(u"Text"),
description=_(u"A text of the product, which is displayed in detailed views"),
default=u"",
required=False,
)
# image = schema.Object(
# title=_(u"Text"),
# schema = IImage,
# description=_(u"The main image of the product"),
# required=False,
# )
#
unlimitedAmount = schema.Bool(
title=_(u"Unlimited Amount"),
description=_(u"If selected, the stock amount of the product is not decreased."),
# HTML "class" attribute; "class" is a keyword in Python.
klass = zope.schema.TextLine(
title=u'Class',
description=(u'This attribute assigns a class name or set of '
u'class names to an element. Any number of elements '
u'may be assigned the same class name or names.'),
required=False)
style = zope.schema.TextLine(
title=u'Style',
description=(u'This attribute offers advisory information about '
u'the element for which it is set.'),
required=False)
title = zope.schema.TextLine(
title=u'Title',
description=(u'This attribute offers advisory information about '
u'the element for which it is set.'),
required=False)
class IHTMLI18nAttributes(zope.interface.Interface):
"""The HTML element 'i18n' attributes."""
lang = zope.schema.TextLine(
title=u'Language',
description=(u"This attribute specifies the base language of an "
u"element's attribute values and text content."),
required=False)
]),
title=_('CMFPlomino_label_number_type',
default="Type"),
description=_('CMFPlomino_help_number_type',
default="Number type"),
default="INTEGER",
required=True)
size = schema.TextLine(
title=_('CMFPlomino_label_number_size',
default="Size"),
description=_('CMFPlomino_help_number_size',
default="Length"),
required=False)
format = schema.TextLine(
title=_('CMFPlomino_label_number_format',
default="Format"),
description=_('CMFPlomino_help_number_format',
default="Number formatting (example: \%1.2f)"),
required=False)
# bug in plone.autoform means order_after doesn't moves correctly
INumberField.setTaggedValue(ORDER_KEY,
[('number_type', 'after', 'field_type'),
('size', 'after', ".number_type"),
('format', 'after', ".size")]
)
@implementer(INumberField)
class NumberField(BaseField):
"""
default_fundraising_seals = schema.List(
title=_(u"Default Fundraising Seals"),
description=_(u"Enter the full physical path (from Zope root) to the default seals to display on Fundraising Campaigns"),
value_type=schema.TextLine(),
required=False,
)
sf_individual_account_id = schema.TextLine(
title=_(u"Salesforce Individual AccountId"),
description=_(u"The ID of the Account in Salesforce that represents Individuals in the \"bucket account\" model. This is typically an account named Individual. This account will be used as the default account when creating the Opportuntity object in Salesforce for a donation"),
required=True,
default=u'',
)
sf_opportunity_record_type_one_time = schema.TextLine(
title=_(u"Salesforce Opportunity Record Type ID - One Time Donations"),
description=_(u"If provided, any Opportunities created from a one time donation will be created as the specified record type"),
required=False,
default=u'',
)
sf_opportunity_record_type_recurring = schema.TextLine(
title=_(u"Salesforce Opportunity Record Type ID - Recurring Donations"),
description=_(u"If provided, any Opportunities created from a recurring donation will be created as the specified record type"),
required=False,
default=u'',
)
sf_opportunity_record_type_product = schema.TextLine(
title=_(u"Salesforce Opportunity Record Type ID = Donation Product Donations"),
description=_(u"If provided, any Opportunities created from a donation product will be created as the specified record type"),
@property
def nicknames(self):
return [self.destination, self.gateway, self.flags, str(self.metrics)]
class NetworkRoutes(Container):
__contains__ = INetworkRoute
__name__ = 'routes'
class INetwork(Interface):
state = schema.Choice(title=u"State", values=(u'active', u'inactive'))
ipv4_address = schema.TextLine(title=u"IPv4 network address", min_length=7)
ipv4_gateway = schema.TextLine(title=u"IPv4 Gateway", min_length=7)
ipv4_address_range = schema.TextLine(title=u"IPv4 Range", min_length=7, required=False)
ipv6_address = schema.TextLine(title=u"IPv6 network address", min_length=7, required=False)
ipv6_gateway = schema.TextLine(title=u"IPv6 Gateway", min_length=6, required=False)
ipv6_address_range = schema.TextLine(title=u"IPv6 Range", min_length=7, required=False)
vlan = schema.TextLine(title=u"VLan", required=False)
label = schema.TextLine(title=u"Label", required=False)
class Network(Model):
implements(INetwork)
def __init__(self, state):
super(Network, self).__init__()
self.state = state
)
cf_api_key = schema.TextLine(
title=u'Cloudflare API Key',
description=u'Setting an API Key here and enabling cache purging '
u'activates purging against Cloudflare.',
required=False
)
cf_email = schema.TextLine(
title=u'Cloudflare Email',
description=u'One associated with cloudflare api key',
required=False
)
cf_zone_id = schema.TextLine(
title=u'Cloudflare Zone ID',
required=False)
rocket_chat_front_page = schema.TextLine(
title=u'Rocket.Chat User URL',
description=u'URL of the Rocket.Chat server to connect to',
required=False
)
rocket_chat_secret = schema.TextLine(
title=u'Rocket.Chat secret',
description=u'Text string used to salt Rocket.Chat authentication tokens',
required=False,
default=unicode(django_random.get_random_string(64))
)
class IQueryListingTileSchema(model.Schema):
title = schema.TextLine(
title=u'Title',
description=u'Provide title above listing',
required=False,
default=None
)
form.widget(query=QueryFieldWidget)
query = schema.List(
title=u'Base query',
description=u"This query can be customized based on user selection",
value_type=schema.Dict(value_type=schema.Field(),
key_type=schema.TextLine()),
required=False
)
sort_on = schema.TextLine(
title=u'Sort on',
description=u"Sort on this index",
required=False,
default=defaults.get('querylisting_tile_sort_on', u'effective')
)
sort_reversed = schema.Bool(
title=u'Reversed order',
description=u'Sort the results in reverse order',
required=False,
default=True
)
target_collection = schema.Choice(
title=_(u"Target collection"),
description=_(u"Find the collection which provides the items to list"),
required=True,
source=SearchableTextSourceBinder(
{'object_provides' : IATTopic.__identifier__},
default_query='path:'))
group_by = schema.Choice(
title=_(u"Group by"),
description=_(u"Select subject you wish to group collection results by."),
required=True,
values = SUBJECT_TO_INDEX.keys(),)
cache_duration = schema.TextLine(
title=_(u"Cache duration"),
description=_(u"How long do you want portlet results to be cached (in minutes)?."),
default=u'60')
class Assignment(base.Assignment):
"""Portlet assignment.
This is what is actually managed through the portlets UI and associated
with columns.
"""
implements(ICollectionBySubject)
header = u""
target_collection=None