def setUp(self): # clear out cache from previous runs keyedcache.cache_delete() g1 = ConfigurationGroup('req1', 'Requirements 1', ordering=1000) self.g1 = g1 bool1 = config_register(BooleanValue(g1, 'bool1', default=False, ordering=1)) bool2 = config_register(BooleanValue(g1, 'bool2', ordering=2)) self.g1c1 = config_register(IntegerValue(g1, 'c1', requires=bool1, ordering=3)) self.g1c2 = config_register(IntegerValue(g1, 'c2', requires=bool2, ordering=4)) self.g1c3 = config_register(IntegerValue(g1, 'c3', ordering=5)) bool2.update(True)
def setUp(self): # clear out cache from previous runs keyedcache.cache_delete() g = ConfigurationGroup('test3', 'test3') self.g = g c1 = config_register(BooleanValue(g, 's1', default=True)) c2 = config_register(IntegerValue(g, 's2', default=10)) c2.update(100)
def register_badge_settings(badge_slug=None, badge_name=None, params=None): settings.register( BooleanValue(BADGES, badge_slug + '_BADGE_ENABLED', default=True, description=_('Enable "%s" badge') % badge_name)) if params is None: return for param_slug, param_data in list(params.items()): param_description = param_data[0] param_default = param_data[1] settings.register( IntegerValue(BADGES, badge_slug + '_BADGE_' + param_slug, description=format_lazy('{}: {}', badge_name, param_description), default=param_default))
# this is so that the translation utility will pick up the string gettext = lambda s: s _strings = (gettext('CreditCard'), gettext('Credit Card')) PAYMENT_GROUP = ConfigurationGroup('PAYMENT_PAYFLOWPRO', _('PayflowPro Payment Settings'), ordering=101) config_register_list( BooleanValue( PAYMENT_GROUP, 'LIVE', description=_("Accept real payments"), help_text=_( "False if you want to submit to the test urls. NOTE: Look " "at the PayflowPro developer's guide " "(https://cms.paypal.com/us/cgi-bin/?cmd=_render-content" "&content_ID=developer/howto_gateway_payflowpro) for the " "list of valid credit card numbers."), default=False), ModuleValue(PAYMENT_GROUP, 'MODULE', description=_('Implementation module'), hidden=True, default='payment.modules.payflowpro'), BooleanValue(PAYMENT_GROUP, 'CAPTURE', description=_('Capture Payment immediately?'), default=True, help_text=_('IMPORTANT: If false, a capture attempt will be '
from django.conf import settings from django.utils.translation import ugettext_lazy as _ from livesettings.values import StringValue, BooleanValue from livesettings.functions import config_register from product.config import PRODUCT_GROUP ENABLE_AKISMET = config_register( BooleanValue(PRODUCT_GROUP, 'AKISMET_ENABLE', description=_("Enable Akismet ratings"), default=False)) AKISMET = config_register( StringValue(PRODUCT_GROUP, 'AKISMET_KEY', description=_("Akismet API Key"), requires=ENABLE_AKISMET, default=""))
#### SHOP Group #### LOGO_URI = config_register( StringValue(SHOP_GROUP, 'LOGO_URI', description=_("URI to the logo for the store"), help_text=_( ("For example http://www.example.com/images/logo.jpg or " "file:///var/www/html/images/logo.jpg")), default=default_icon_url)) ENFORCE_STATE = config_register( BooleanValue( SHOP_GROUP, 'ENFORCE_STATE', description=_('State required?'), help_text= _("Require a state during registration/checkout for countries that have states?" ), default=True)) SHOW_SITE = config_register( BooleanValue( SHOP_GROUP, 'SHOW_SITE', description=_('Show Site Field?'), help_text= _("Should the Site field be displayed in the admin lists? A server restart is required for this to take effect." ), default=True)) config_register(
""" Social sharing settings """ from django.utils.translation import ugettext_lazy as _ from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import EXTERNAL_SERVICES from livesettings.values import ConfigurationGroup, BooleanValue, \ StringValue SOCIAL_SHARING = ConfigurationGroup('SOCIAL_SHARING', _('Content sharing'), super_group=EXTERNAL_SERVICES) settings.register( BooleanValue(SOCIAL_SHARING, 'RSS_ENABLED', default=True, description=_('Check to enable RSS feeds'))) settings.register( StringValue(SOCIAL_SHARING, 'SHARING_SUFFIX_TEXT', default='', description=_('Hashtag or suffix to sharing messages'))) settings.register( BooleanValue( SOCIAL_SHARING, 'ENABLE_SHARING_TWITTER', default=True, description=_('Check to enable sharing of questions on Twitter'), help_text=_('Important - to actually start sharing on twitter, '
)), ModuleValue(PAYMENT_GROUP, 'MODULE', description=_('Implementation module'), hidden=True, default='payment.modules.giftcertificate'), StringValue( PAYMENT_GROUP, 'LABEL', description=_('English name for this group on the checkout screens'), default='Gift Certificate', dummy=_('Gift Certificate'), # Force this to appear on po-files help_text=_('This will be passed to the translation utility')), BooleanValue(PAYMENT_GROUP, 'LIVE', description=_("Accept real payments"), help_text=_("False if you want to be in test mode"), default=False), BooleanValue( PAYMENT_GROUP, 'EMAIL_RECIPIENT', description=_("Send email to recipients"), help_text= _("If the purchaser includes an email address, should we send a notification to them?" ), default=True), StringValue( PAYMENT_GROUP, 'URL_BASE', description= _('The url base used for constructing urlpatterns which will use this module'
_("The default weight for items which lack a defined weight and the minimum an item is allowed to be, enter a positive value." ), default='0.5', ), StringValue(SHIPPING_GROUP, 'DEFAULT_WEIGHT_UNITS', description=_("Default weight units"), choices=( ('LB', 'LB'), ('KG', 'KG'), ), default="LB"), BooleanValue( SHIPPING_GROUP, 'SINGLE_BOX', description=_("Single Box?"), help_text= _("Use just one box and ship by weight? If no then every item will be sent in its own box." ), default=True), StringValue( SHIPPING_GROUP, 'DROPOFF_TYPE', description=_("The method used to give the package to Fedex."), choices=( ('REGULAR_PICKUP', 'REGULAR_PICKUP'), ('BUSINESS_SERVICE_CENTER', 'BUSINESS_SERVICE_CENTER'), ('DROP_BOX', 'DROP_BOX'), ('REQUEST_COURIER', 'REQUEST_COURIER'), ('STATION', 'STATION'), ), help_text=_("Most users will keep the default Regular Pickup."),
help_text=_("The cost of packaging and getting the package off"), default=Decimal('0.00')), StringValue(SHIPPING_GROUP, 'SHIPPING_CONTAINER', description=_("Type of container used to ship product."), choices = ( (('00', 'Unknown')), (('01', 'UPS LETTER')), (('02', 'PACKAGE / CUSTOMER SUPPLIED')), ), default = "00"), BooleanValue(SHIPPING_GROUP, 'SINGLE_BOX', description=_("Single Box?"), help_text=_("Use just one box and ship by weight? If no then every item will be sent in its own box."), default=True), BooleanValue(SHIPPING_GROUP, 'TIME_IN_TRANSIT', description=_("Time in Transit?"), help_text=_("Use the UPS Time In Transit API? It is slower but delivery dates are more accurate."), default=False), StringValue(SHIPPING_GROUP, 'PICKUP_TYPE', description=_("UPS Pickup option."), choices = ( (('01', 'DAILY PICKUP')), (('03', 'CUSTOMER COUNTER')),
regex_list = new_value.split('\n') for i in range(0, len(regex_list)): re.compile(regex_list[i].strip()) return args[1] except re.error: # The regex is invalid, so we overwrite it with empty string return "" settings.register( BooleanValue(MARKUP, 'MARKUP_CODE_FRIENDLY', description=_('Enable code-friendly Markdown'), help_text=_('If checked, underscore characters will not ' 'trigger italic or bold formatting - ' 'bold and italic text can still be marked up ' 'with asterisks. Note that "MathJax support" ' 'implicitly turns this feature on, because ' 'underscores are heavily used in LaTeX input.'), default=False)) settings.register( BooleanValue( MARKUP, 'ENABLE_MATHJAX', description=_('Mathjax support (rendering of LaTeX)'), help_text=_('If you enable this feature, ' '<a href="%(url)s">mathjax</a> must be ' 'installed on your server in its own directory.') % {'url': const.DEPENDENCY_URLS['mathjax']}, default=False))
from django.utils.translation import ugettext_lazy as _ from livesettings.values import BooleanValue, DecimalValue from livesettings.functions import config_register, config_get_group from tax.config import TAX_MODULE TAX_MODULE.add_choice(('tax.modules.percent', _('Percent Tax'))) TAX_GROUP = config_get_group('TAX') config_register( DecimalValue(TAX_GROUP, 'PERCENT', description=_("Percent tax"), requires=TAX_MODULE, requiresvalue='tax.modules.percent', default="0")) config_register( BooleanValue(TAX_GROUP, 'TAX_SHIPPING_PERCENT', description=_("Tax Shipping?"), requires=TAX_MODULE, requiresvalue='tax.modules.percent', default=False))
from livesettings.functions import config_register_list from livesettings.values import ConfigurationGroup, IntegerValue, BooleanValue from django.utils.translation import ugettext_lazy as _ THUMB_GROUP = ConfigurationGroup('THUMBNAIL', _('Thumbnail Settings')) config_register_list( IntegerValue( THUMB_GROUP, 'IMAGE_QUALITY', description=_("Thumbnail quality"), help_text= _("Use a 1-100 value here, which will change the quality of JPG thumbnails created for products and categories." ), default=75, ordering=0), BooleanValue(THUMB_GROUP, 'RENAME_IMAGES', description=_("Rename product images?"), help_text=_("Automatically rename product images on upload?"), default=True))
_('TrustCommerce Payment Settings'), ordering=102) config_register_list( StringValue(PAYMENT_GROUP, 'KEY', description=_("Module key"), hidden=True, default='TRUSTCOMMERCE'), ModuleValue(PAYMENT_GROUP, 'MODULE', description=_('Implementation module'), hidden=True, default='payment.modules.trustcommerce'), BooleanValue(PAYMENT_GROUP, 'AVS', description=_("Use Address Verification System (AVS)?"), default=False), BooleanValue(PAYMENT_GROUP, 'LIVE', description=_("Accept real payments"), help_text=_("False if you want to be in test mode"), default=False), StringValue( PAYMENT_GROUP, 'AUTH_TYPE', description=_("Type of authorization to perform."), help_text=_("Refer to manual for details on the different types."), default='sale', choices=[('sale', _('Sale')), ('preauth', _('Preauth'))]), StringValue( PAYMENT_GROUP,
TAX_GROUP, 'MODULE', description=_("Active tax module"), help_text= _("Select a module, save and reload to set any module-specific settings." ), default="tax.modules.no", choices=[ ('tax.modules.no', _('No Tax')), ])) DEFAULT_VIEW_TAX = config_register( BooleanValue( TAX_GROUP, 'DEFAULT_VIEW_TAX', description=_("Show with tax included"), help_text= _("If yes, then all products and the cart will display with tax included." ), default=False)) PRODUCTS_TAXABLE_BY_DEFAULT = config_register( BooleanValue( TAX_GROUP, 'PRODUCTS_TAXABLE_BY_DEFAULT', description=_("New products are automatically made taxable"), help_text=_( "Whether newly created products should be taxable by default."), default=False)) TAX_AREA_ADDRESS = config_register( StringValue(
"""Adds Configuration-module specific configuration options""" from django.utils.translation import ugettext_lazy as _ from livesettings.functions import config_register from livesettings.values import BooleanValue from product.config import PRODUCT_GROUP config_register( BooleanValue( PRODUCT_GROUP, 'SEARCH_SHOW_PRODUCTVARIATIONS', description=_("Show product variations in search results?"), help_text=_( "If yes, the product variations will show up in searches."), default=True))
StringValue(PAYMENT_GROUP, 'PSPID', description=_('Concardis PSPID'), help_text=_('The PSPID for your Concardis account'), default=''), StringValue( PAYMENT_GROUP, 'RETURN_ADDRESS', description=_('Return URL'), help_text= _('Where Concardis will return the customer after the purchase is complete. This can be a named url and defaults to the standard checkout success.' ), default='satchmo_checkout-success'), BooleanValue(PAYMENT_GROUP, 'LIVE', description=_('Accept real payments'), help_text=_('False if you want to be in test mode'), default=False), ModuleValue(PAYMENT_GROUP, 'MODULE', description=_('Implementation module'), hidden=True, default='djangoplicity.concardis'), StringValue(PAYMENT_GROUP, 'KEY', description=_('Module key'), hidden=True, default='CONCARDIS'), StringValue( PAYMENT_GROUP, 'LABEL',
from django.utils.translation import ugettext_lazy as _ from livesettings.values import StringValue, ConfigurationGroup, BooleanValue from livesettings.functions import config_register, config_get_group from tax.config import TAX_MODULE TAX_MODULE.add_choice(('tax.modules.area', _('By Country/Area'))) TAX_GROUP = config_get_group('TAX') config_register( BooleanValue(TAX_GROUP, 'TAX_SHIPPING_AREA', description=_("Tax Shipping?"), requires=TAX_MODULE, requiresvalue='tax.modules.area', default=False)) config_register( StringValue( TAX_GROUP, 'TAX_CLASS', description=_("TaxClass for shipping"), help_text=_("Select a TaxClass that should be applied for shipments."), requires=TAX_MODULE, requiresvalue='tax.modules.area', #TODO: [BJK] make this dynamic - doesn't work to have it be preloaded. default='Shipping'))
else: for key in LARGE_SITE_MODE_SETTINGS: settings.reset(key) return new_value SITE_MODES = ConfigurationGroup( 'SITE_MODES', _('Bootstrap mode'), super_group=REP_AND_BADGES ) settings.register( BooleanValue( SITE_MODES, 'ACTIVATE_LARGE_SITE_MODE', default=False, description=_('Activate a "Large site" mode'), help_text=_( "\"Large site\" mode increases reputation and certain badge " "thresholds, to values, more suitable for the larger communities, " "<strong>WARNING:</strong> your current values for " "Minimum reputation, Badge Settings and Vote Rules will " "be changed after you modify this setting." ), update_callback=bootstrap_callback ) )
from django.utils.translation import ugettext_lazy as _ from livesettings.values import StringValue, BooleanValue from livesettings.functions import config_register, config_get, config_get_group import tax.config TAX_MODULE = config_get('TAX', 'MODULE') TAX_MODULE.add_choice(('tax.modules.us_sst', _('USA: Streamlined Sales Tax'))) TAX_GROUP = config_get_group('TAX') # varies state-to-state, so we need to support this being variable. config_register( BooleanValue(TAX_GROUP, 'TAX_SHIPPING_SST', description=_("Tax Shipping in ANY jurisdiction?"), requires=TAX_MODULE, requiresvalue='tax.modules.us_sst', default=True)) config_register( StringValue( TAX_GROUP, 'TAX_CLASS', description=_("TaxClass for shipping"), help_text=_("Select a TaxClass that should be applied for shipments."), #TODO: [BJK] make this dynamic - doesn't work to have it be preloaded. default='Shipping'))
CRON_KEY = config_register( StringValue( PAYMENT_GROUP, 'CRON_KEY', description=_("Cron Passkey"), help_text= _("Enter an authentication passkey to secure your recurring billing cron url." ), default="x1234replace_me")) ALLOW_URL_CRON = config_register( BooleanValue( PAYMENT_GROUP, 'ALLOW_URL_REBILL', description=_("Allow URL Access to Cron for subscription rebills"), help_text=_( "Do you want to allow remote url calls for subscription billing?"), default=False)) PAYMENT_LIVE = config_register( BooleanValue( PAYMENT_GROUP, 'LIVE', description=_("Accept real payments"), help_text= _("False if you want to be in test mode. This is the master switch, turn it off to force all payments into test mode." ), default=False)) ORDER_EMAIL = config_register(
PAYMENT_GROUP, 'CONNECTION_TEST', description=_("Submit to Test URL"), help_text= ("""If you have a test account with authorize.net and you log in through https://test.authorize.net/gateway/transact.dll, then you should use the default test URL. If you do not have a test account you will get an Error 13 message unless you change the URL to https://secure.authorize.net/gateway/transact.dll. You will also need to login in to authorize.net and make sure your account has test mode turned on. """), default='https://test.authorize.net/gateway/transact.dll'), BooleanValue( PAYMENT_GROUP, 'LIVE', description=_("Accept real payments"), help_text= _("False if you want to submit to the test urls. NOTE: If you are testing, then you can use the cc# 4222222222222 to force a bad credit card response. If you use that number and a ccv of 222, that will force a bad ccv response from authorize.net" ), default=False), BooleanValue( PAYMENT_GROUP, 'SIMULATE', description=_("Force a test post?"), help_text= _("True if you want to submit to the live url using a test flag, which won't be accepted." ), default=False), ModuleValue(PAYMENT_GROUP, 'MODULE', description=_('Implementation module'), hidden=True,
from livesettings.values import StringValue, ConfigurationGroup, BooleanValue, DecimalValue, PositiveIntegerValue, ModuleValue, MultipleStringValue, LongStringValue from livesettings.functions import config_register_list from django.utils.translation import ugettext_lazy as _ # this is so that the translation utility will pick up the string gettext = lambda s: s PAYMENT_GROUP = ConfigurationGroup('PAYMENT_DUMMY', _('Payment Test Module Settings'), ordering=100) config_register_list( BooleanValue(PAYMENT_GROUP, 'LIVE', description=_("Accept real payments"), help_text=_("False if you want to be in test mode"), default=False), ModuleValue(PAYMENT_GROUP, 'MODULE', description=_('Implementation module'), hidden=True, default='payment.modules.dummy'), StringValue(PAYMENT_GROUP, 'KEY', description=_("Module key"), hidden=True, default='DUMMY'), StringValue( PAYMENT_GROUP, 'LABEL', description=_('English name for this group on the checkout screens'),
PRODUCT_GROUP, 'NUM_PAGINATED', description=_("Number featured"), help_text=_("Number of featured items to display on each page"), default=10), MultipleStringValue( PRODUCT_GROUP, 'MEASUREMENT_SYSTEM', description=_("Measurement System"), help_text=_("Default measurement system to use for products."), choices=[('metric', _('Metric')), ('imperial', _('Imperial'))], default="imperial"), BooleanValue( PRODUCT_GROUP, 'NO_STOCK_CHECKOUT', description=_("Allow checkout with 0 inventory?"), help_text= _("If yes, then customers can buy even if your inventory is 0 for a product." ), default=True), BooleanValue( PRODUCT_GROUP, 'RANDOM_FEATURED', description=_("Random Display"), help_text=_("Enable random display of featured products on home page"), default=False), BooleanValue( PRODUCT_GROUP, 'TRACK_INVENTORY', description=_("Track inventory levels?"), help_text=_( "If no, then inventory will not be tracked for products sold."),
'1020', '1030', '1040', )), StringValue(SHIPPING_GROUP, 'SHIPPING_CONTAINER', description=_("Type of container used to ship product."), choices=( (('00', 'Unknown')), (('01', 'Variable')), (('02', 'Rectangular')), ), default="00"), BooleanValue(SHIPPING_GROUP, 'LIVE', description=_('Access production Canada Post server'), help_text=_('Use this when your store is in production.'), default=False), StringValue( SHIPPING_GROUP, 'CONNECTION', description=_('Submit to URL'), help_text=_( 'Canada Post Sell Online server to submit live transactions.'), default='http://sellonline.canadapost.ca:30000'), StringValue( SHIPPING_GROUP, 'CONNECTION_TEST', description=_('Submit to TestURL'), help_text=_( 'Canada Post Sell Online server to submit test transactions.'),
from livesettings.values import StringValue,ConfigurationGroup,BooleanValue,ModuleValue from livesettings.functions import config_register_list from django.utils.translation import ugettext_lazy as _ PAYMENT_GROUP = ConfigurationGroup('PAYMENT_PURCHASEORDER', _('Purchase Order Module Settings'), ordering = 100) config_register_list( BooleanValue(PAYMENT_GROUP, 'LIVE', description=_("Accept real payments"), help_text=_("False if you want to be in test mode"), default=False), ModuleValue(PAYMENT_GROUP, 'MODULE', description=_('Implementation module'), hidden=True, default = 'payment.modules.purchaseorder'), StringValue(PAYMENT_GROUP, 'KEY', description=_("Module key"), hidden=True, default = 'PURCHASEORDER'), StringValue(PAYMENT_GROUP, 'LABEL', description=_('English name for this group on the checkout screens'), default = 'Purchase Order',
# this is so that the translation utility will pick up the string gettext = lambda s: s _strings = (gettext('CreditCard'), gettext('Credit Card'), gettext('Sage Pay Secure Payments')) # These cards require the issue number and start date fields filled in. REQUIRES_ISSUE_NUMBER = ('MAESTRO', 'SOLO') PAYMENT_GROUP = ConfigurationGroup('PAYMENT_SAGEPAY', _('Sage Pay Payment Settings'), ordering=101) config_register_list( BooleanValue(PAYMENT_GROUP, 'LIVE', description=_("Accept real payments"), help_text=_("False if you want to be in test mode"), default=False), BooleanValue(PAYMENT_GROUP, 'SIMULATOR', description=_("Simulated Transactions?"), help_text=_("Must be false to accept real payments"), default=False), BooleanValue( PAYMENT_GROUP, 'SKIP_POST', description=_("Skip post?"), help_text= _("For testing only, this will skip actually posting to Sage Pay servers. This is because their servers restrict IPs of posting servers, even for tests. If you are developing on a desktop, you'll have to enable this." ), default=False),
StringValue( SHIPPING_GROUP, 'HIDING', description=_("Hide if one?"), help_text=_( "Hide shipping form fields if there is only one choice available?" ), default='NO', ordering=10, choices=(('NO', _('No')), ('YES', _('Yes')), ('DESCRIPTION', _('Show description only'))))) config_register( BooleanValue(SHIPPING_GROUP, 'DOWNLOAD_PDFS', description=_("Download PDFs from admin page"), default=True, ordering=5)) config_register( BooleanValue(SHIPPING_GROUP, 'SELECT_CHEAPEST', description=_("Select least expensive by default?"), default=True, ordering=15)) # --- Load default shipping modules. Ignore import errors, user may have deleted them. --- # DO NOT ADD 'tiered' or 'no' to this list. # 'no' is used internally # 'Tiered' is special, since it needs to be added as a module. To enable it, # just add shipping.modules.tiered to your INSTALLED_APPS
'Enter one phrase per line (case-insensitive). ' 'Posts with these phrases will be rejected ' 'without moderation.'))) settings.register( LongStringValue(MODERATION, 'INVITED_MODERATORS', default='', description=_('Invited moderators'), help_text=_( 'Use one line per user; on each line enter ' 'email address and user name separated by spaces'))) settings.register( BooleanValue(MODERATION, 'MODERATE_IMAGES', default=False, description=_('Enable image moderation'))) settings.register( BooleanValue(MODERATION, 'MODERATE_LINKS', default=False, description=_('Enable link moderation'))) settings.register( BooleanValue(MODERATION, 'ENABLE_TAG_MODERATION', default=False, description=_('Enable tag moderation'), help_text=_( 'If enabled, any new tags will not be applied '
from livesettings.functions import config_register from livesettings.values import StringValue, IntegerValue, BooleanValue, MultipleStringValue from satchmo_store.shop.config import SHOP_GROUP from django.utils.translation import ugettext_lazy as _ config_register( BooleanValue( SHOP_GROUP, 'AUTHENTICATION_REQUIRED', description=_("Only authenticated users can check out"), help_text= _("Users will be required to authenticate (and create an account if neccessary) before checkout." ), default=False, )) config_register( MultipleStringValue( SHOP_GROUP, 'REQUIRED_BILLING_DATA', description=_("Required billing data"), help_text= _("Users may be required to provide some set of billing address. Other fields are optional. " "You may shorten the checkout process here, but be careful, as this may leave you orders " "with almost no customer data! Some payment modules may override this setting." ), default=('email', 'first_name', 'last_name', 'phone', 'street1', 'city', 'postal_code', 'country'), choices=(('email', _("Email")), ('title', _("Title")), ('first_name', _("First name")), ('last_name',