Exemplo n.º 1
0
    def setUp(self):
        # clear out cache from previous runs
        keyedcache.cache_delete()

        g1 = ConfigurationGroup('reqval', 'Requirements 3', ordering=1000)

        self.g1 = g1

        choices1 = config_register(MultipleStringValue(BASE_GROUP, 'valchoices', ordering=1))

        self.g1c1 = config_register(IntegerValue(g1, 'c1', requires=choices1, requiresvalue='foo', ordering=3))
        self.g1c2 = config_register(IntegerValue(g1, 'c2', requires=choices1, requiresvalue='bar', ordering=4))
        self.g1c3 = config_register(IntegerValue(g1, 'c3', ordering=5))

        choices1.update('foo')

        g2 = ConfigurationGroup('reqval2', 'Requirements 4', ordering=1000)

        self.g2 = g2

        choices2 = config_register(StringValue(BASE_GROUP, 'valchoices2', ordering=1,
            choices=(('a', 'test a'), ('b', 'test b'), ('c', 'test c'))))

        self.g2c1 = config_register(IntegerValue(g2, 'c1', requires=choices2, requiresvalue='a', ordering=3))
        self.g2c2 = config_register(IntegerValue(g2, 'c2', requires=choices2, requiresvalue='b', ordering=4))
        self.g2c3 = config_register(IntegerValue(g2, 'c3', requires=choices2, requiresvalue='c', ordering=5))

        choices2.update('a')
Exemplo n.º 2
0
    def setUp(self):
        # clear out cache from previous runs
        keyedcache.cache_delete()

        g1 = ConfigurationGroup('req2', 'Requirements 2', ordering=1000)

        self.g1 = g1

        choices1 = config_register(
            MultipleStringValue(BASE_GROUP, 'rc1', ordering=1))

        self.g1c1 = config_register(
            IntegerValue(g1, 'c1', requires=choices1, ordering=3))
        self.g1c2 = config_register(
            IntegerValue(g1, 'c2', requires=choices1, ordering=4))
        self.g1c3 = config_register(IntegerValue(g1, 'c3', ordering=5))

        choices1.update('c1')

        g2 = ConfigurationGroup('req3', 'Requirements 3', ordering=1000)

        self.g2 = g2

        choices2 = config_register(
            StringValue(BASE_GROUP, 'choices2', ordering=1))

        self.g2c1 = config_register(
            IntegerValue(g2, 'c1', requires=choices2, ordering=3))
        self.g2c2 = config_register(
            IntegerValue(g2, 'c2', requires=choices2, ordering=4))
        self.g2c3 = config_register(
            IntegerValue(g2, 'c3', requires=choices2, ordering=5))

        choices2.update('c1')
Exemplo n.º 3
0
 def setUp(self):
     # clear out cache from previous runs
     keyedcache.cache_delete()
     g = ConfigurationGroup('test2', 'test2')
     self.g = g
     config_register(StringValue(g, 's1'))
     config_register(IntegerValue(g, 's2', default=10))
     config_register(IntegerValue(g, 's3', default=10))
Exemplo n.º 4
0
    def testSetTwoConfigItems(self):
        s = [
            IntegerValue(BASE_GROUP, 'testTwoA'),
            StringValue(BASE_GROUP, 'testTwoB')
        ]
        config_register_list(*s)

        self.assert_(config_exists(BASE_GROUP, 'testTwoA'))
        self.assert_(config_exists(BASE_GROUP, 'testTwoB'))
Exemplo n.º 5
0
    def setUp(self):
        keyedcache.cache_delete()
        choices = config_register(MultipleStringValue(BASE_GROUP, 'collect', ordering=1))
        self.choices = choices

        g1 = ConfigurationGroup('coll1', 'Collection 1')
        g2 = ConfigurationGroup('coll2', 'Collection 2')
        g3 = ConfigurationGroup('coll3', 'Collection 3')

        g1c1 = config_register(StringValue(g1, 'test'))
        g1c2 = config_register(StringValue(g1, 'test1'))
        g2c1 = config_register(StringValue(g2, 'test'))
        g3c1 = config_register(StringValue(g3, 'test'))

        g1c1.update('set a')
        g1c2.update('set b')
        g2c1.update('set a')
        g3c1.update('set d')

        choices.update(['coll1', 'coll3'])
Exemplo n.º 6
0
    def testAddPreregisteredChoice(self):
        """Test that we can register choices before the config is actually set up."""
        config_add_choice('ctg1', 'c1', ('a', 'Item A'))
        config_add_choice('ctg1', 'c1', ('b', 'Item B'))
        config_add_choice('ctg1', 'c1', ('c', 'Item C'))

        g1 = ConfigurationGroup('ctg1', 'Choice 1', ordering=1000)
        config_register(StringValue(g1, 'c1'))

        c = config_get('ctg1', 'c1')

        self.assertEqual(c.choices, [('a', 'Item A'), ('b', 'Item B'), ('c', 'Item C')])
Exemplo n.º 7
0
    def setUp(self):
        # clear out cache from previous runs
        keyedcache.cache_delete()

        djangosettings.LIVESETTINGS_OPTIONS = {
            1: {
                'DB': False,
                'SETTINGS': {
                    'overgroup': {
                        's2': '100',
                        'choices': '["one","two","three"]'
                    }
                }
            }
        }

        g = ConfigurationGroup('overgroup', 'Override Group')
        self.g = g
        config_register(StringValue(g, 's1'))
        config_register(IntegerValue(g, 's2', default=10))
        config_register(IntegerValue(g, 's3', default=10))
        config_register(MultipleStringValue(g, 'choices'))
Exemplo n.º 8
0
from livesettings.values import StringValue, DecimalValue
from livesettings.functions import config_register_list, config_get, config_get_group

SHIP_MODULES = config_get('SHIPPING', 'MODULES')

# No need to add the choice, since it is in by default
# SHIP_MODULES.add_choice(('shipping.modules.per', _('Per piece')))

SHIPPING_GROUP = config_get_group('SHIPPING')

config_register_list(
    DecimalValue(SHIPPING_GROUP,
                 'PER_RATE',
                 description=_("Per item price"),
                 requires=SHIP_MODULES,
                 requiresvalue='shipping.modules.per',
                 default="4.00"),
    StringValue(SHIPPING_GROUP,
                'PER_SERVICE',
                description=_("Per Item Shipping Service"),
                help_text=_("Shipping service used with per item shipping"),
                requires=SHIP_MODULES,
                requiresvalue='shipping.modules.per',
                default="U.S. Mail"),
    StringValue(SHIPPING_GROUP,
                'PER_DAYS',
                description=_("Per Item Delivery Days"),
                requires=SHIP_MODULES,
                requiresvalue='shipping.modules.per',
                default="3 - 4 business days"))
Exemplo n.º 9
0
                                   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'),
        default='Payment test module',
        dummy=_('Payment test module'),  # Force this to appear on po-files
        help_text=_('This will be passed to the translation utility')),
    StringValue(
        PAYMENT_GROUP,
        'URL_BASE',
        description=
        _('The url base used for constructing urlpatterns which will use this module'
          ),
Exemplo n.º 10
0
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, '
                    'it is required to set up Twitter consumer key and secret '
                    'in the "keys to external services" section.')))

settings.register(
    BooleanValue(
        SOCIAL_SHARING,
Exemplo n.º 11
0
from livesettings.functions import config_register, config_register_list, config_get_group, config_choice_values, config_value
from payment import signals, active_gateways
from satchmo_utils import is_string_like
import logging

_ = ugettext_lazy

log = logging.getLogger('payment.config')

PAYMENT_GROUP = ConfigurationGroup('PAYMENT', _('Payment Settings'))

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(
Exemplo n.º 12
0
from livesettings.values import StringValue,ConfigurationGroup,BooleanValue,DecimalValue,MultipleStringValue
from livesettings.functions import config_register_list,config_get

SHIP_MODULES = config_get('SHIPPING', 'MODULES')
SHIP_MODULES.add_choice(('shipping.modules.ups', 'UPS'))

SHIPPING_GROUP = ConfigurationGroup('shipping.modules.ups',
    _('UPS Shipping Settings'),
    requires = SHIP_MODULES,
    ordering = 101)

config_register_list(

    StringValue(SHIPPING_GROUP,
        'XML_KEY',
        description=_("UPS XML Access Key"),
        help_text=_("XML Access Key Provided by UPS"),
        default=""),

    StringValue(SHIPPING_GROUP,
        'USER_ID',
        description=_("UPS User ID"),
        help_text=_("User ID provided by UPS site."),
        default=""),

    StringValue(SHIPPING_GROUP,
        'ACCOUNT',
        description=_("UPS Account Number"),
        help_text=_("UPS Account Number."),
        default=""),
Exemplo n.º 13
0
from livesettings.values import StringValue, ConfigurationGroup, BooleanValue, DecimalValue, ModuleValue, MultipleStringValue
from livesettings.functions import config_register, 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
_strings = (gettext('CreditCard'), gettext('Credit Card'))

PAYMENT_GROUP = ConfigurationGroup('PAYMENT_AUTHORIZENET',
                                   _('Authorize.net Payment Settings'),
                                   ordering=101)

config_register_list(
    StringValue(
        PAYMENT_GROUP,
        'CONNECTION',
        description=_("Submit to URL"),
        help_text=_("""This is the address to submit live transactions."""),
        default='https://secure.authorize.net/gateway/transact.dll'),
    StringValue(
        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'),
Exemplo n.º 14
0
from livesettings.functions import config_register_list, config_get

SHIP_MODULES = config_get('SHIPPING', 'MODULES')
SHIP_MODULES.add_choice(('shipping.modules.canadapost', 'Canada Post'))

SHIPPING_GROUP = ConfigurationGroup(
    'shipping.modules.canadapost',
    _('Canada Post Shipping Settings'),
    requires=SHIP_MODULES,
    requiresvalue='shipping.modules.canadapost',
    ordering=101)

config_register_list(
    StringValue(SHIPPING_GROUP,
                'CPCID',
                description=_('Canada Post Merchant ID'),
                help_text=_('The merchant ID assigned by Canada Post'),
                default='CPC_DEMO_XML'),

    #http://sellonline.canadapost.ca/DevelopersResources/protocolV3/ProductID.html
    MultipleStringValue(
        SHIPPING_GROUP,
        'CANADAPOST_SHIPPING_CHOICES',
        description=_("Canada Post shipping choices available to customers."),
        choices=(
            (('1010', 'Domestic - Regular')),
            (('1020', 'Domestic - Expedited')),
            (('1030', 'Domestic - Xpresspost')),
            (('1040', 'Domestic - Priority Courier')),
            (('2005', 'US - Small Packets Surface')),
            (('2015', 'US - Small Packets Air')),
Exemplo n.º 15
0
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'))
Exemplo n.º 16
0
from django.utils.translation import ugettext_lazy as _

from livesettings.values import ConfigurationGroup, StringValue
from livesettings.functions import config_register
import logging
log = logging.getLogger('tiered.config')
from shipping.config import SHIPPING_ACTIVE

SHIPPING_ACTIVE.add_choice(('shipping.modules.tiered', _('Tiered Shipping')))

log.debug('loaded')

SHIPPING_TIERED_GROUP = ConfigurationGroup('SHIPPING_TIERED',
                                           _('Shipping Tiered Settings'))

config_register(
    StringValue(
        SHIPPING_TIERED_GROUP,
        'MIN_PRICE_FOR',
        description=_("Min Price relates to"),
        help_text=_("By default Min Price only for total of shippable items"),
        default='SHIPPABLE',
        ordering=15,
        choices=(
            ('SHIPPABLE', _('Only shippable items')),
            ('NOT_DISCOUNTABLE', _('Not discountable total')),
        )))
Exemplo n.º 17
0
# -*- coding: utf-8 -*-

from django.utils.translation import ugettext_lazy as _
from livesettings.values import ConfigurationGroup, PositiveIntegerValue, MultipleStringValue, StringValue, BooleanValue
from livesettings.functions import config_register, config_register_list

PRODUCT_GROUP = ConfigurationGroup('PRODUCT', _('Product Settings'))

config_register(
    StringValue(PRODUCT_GROUP,
                'IMAGE_DIR',
                description=_("Upload Image Dir"),
                help_text=_("""Directory name for storing uploaded images.
    This value will be appended to MEDIA_ROOT.  Do not worry about slashes.
    We can handle it any which way."""),
                default="images"))

config_register_list(
    PositiveIntegerValue(
        PRODUCT_GROUP,
        'NUM_DISPLAY',
        description=_("Total featured"),
        help_text=_("Total number of featured items to display"),
        default=20),
    PositiveIntegerValue(
        PRODUCT_GROUP,
        'NUM_PAGINATED',
        description=_("Number featured"),
        help_text=_("Number of featured items to display on each page"),
        default=10),
    MultipleStringValue(
Exemplo n.º 18
0
from django.utils.translation import ugettext_lazy as _
from livesettings.functions import config_register
from livesettings.values import StringValue, ConfigurationGroup


SETTINGS_GROUP = ConfigurationGroup('Telegram API', _('Telegram API Settings'), ordering=0)

config_register(StringValue(
    SETTINGS_GROUP,
    'TG_API_ID',
    description=_("Telegram API ID"),
    help_text=_("api_id value retrieved from my.telegram.org"),
))

config_register(StringValue(
    SETTINGS_GROUP,
    'TG_API_HASH',
    description=_("Telegram API Hash"),
    help_text=_("api_hash value retrieved from my.telegram.org"),
))
Exemplo n.º 19
0
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
_strings = (gettext('CreditCard'), gettext('Credit Card'))

PAYMENT_GROUP = ConfigurationGroup('PAYMENT_CYBERSOURCE',
                                   _('Cybersource.net Payment Settings'),
                                   ordering=102)

config_register_list(
    StringValue(
        PAYMENT_GROUP,
        'CONNECTION',
        description=_("WSDL URL"),
        help_text=_("""This is the address to submit live transactions."""),
        default=
        'https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.26.wsdl'
    ),
    StringValue(
        PAYMENT_GROUP,
        'CONNECTION_TEST',
        description=_("Submit to Test WSDL URL"),
        help_text=("""This is the address to submit test transactions"""),
        default=
        'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor/CyberSourceTransaction_1.26.wsdl'
    ),
    BooleanValue(PAYMENT_GROUP,
                 'LIVE',
                 description=_("Accept real payments"),
                 help_text=_("False if you want to be in test mode"),
Exemplo n.º 20
0
project_root = os.path.dirname(
    os.path.normpath(
        sys.modules[os.environ['DJANGO_SETTINGS_MODULE']].__file__))
# default value `project_root + 'static'` is currently the best common for all Django 1.2 - 1.4
default_icon_url = urllib.parse.urlunsplit(
    ('file', '', os.path.join(project_root, 'static',
                              'images/sample-logo.bmp'), '', ''))

#### 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(
Exemplo n.º 21
0
from django.utils.translation import ugettext_lazy as _
from livesettings.values import StringValue, ConfigurationGroup, BooleanValue, DecimalValue, MultipleStringValue
from livesettings.functions import config_register_list, config_get

SHIP_MODULES = config_get('SHIPPING', 'MODULES')
SHIP_MODULES.add_choice(('shipping.modules.usps', 'USPS'))

SHIPPING_GROUP = ConfigurationGroup('shipping.modules.usps',
                                    _('U.S.P.S. Shipping Settings'),
                                    requires=SHIP_MODULES,
                                    ordering=101)

config_register_list(
    StringValue(SHIPPING_GROUP,
                'USER_ID',
                description=_("USPS  Username"),
                help_text=_("User ID provided by USPS site."),
                default=""),
    StringValue(SHIPPING_GROUP,
                'USER_PASSWORD',
                description=_("USPS Password"),
                help_text=_("User password provided by USPS site."),
                default=""),
    DecimalValue(
        SHIPPING_GROUP,
        'HANDLING_FEE',
        description=_("Handling Fee"),
        help_text=_("The cost of packaging and taking order to post office"),
        default=Decimal('0.00')),
    MultipleStringValue(
        SHIPPING_GROUP,
Exemplo n.º 22
0
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=""))
Exemplo n.º 23
0
        'MODULES',
        description=_("Active shipping modules"),
        help_text=
        _("Select the active shipping modules, save and reload to set any module-specific shipping settings."
          ),
        default=["shipping.modules.per"],
        choices=[('shipping.modules.per', _('Per piece'))],
        ordering=0))

config_register(
    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,
Exemplo n.º 24
0
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_PAYPAL',
                                   _('Paypal Payment Module Settings'),
                                   ordering=101)

config_register_list(
    StringValue(PAYMENT_GROUP,
                'CURRENCY_CODE',
                description=_('Currency Code'),
                help_text=_('Currency code for Paypal transactions.'),
                default='USD'),
    StringValue(PAYMENT_GROUP,
                'POST_URL',
                description=_('Post URL'),
                help_text=_('The Paypal URL for real transaction posting.'),
                default="https://www.paypal.com/cgi-bin/webscr"),
    StringValue(PAYMENT_GROUP,
                'POST_TEST_URL',
                description=_('Post URL'),
                help_text=_('The Paypal URL for test transaction posting.'),
                default="https://www.sandbox.paypal.com/cgi-bin/webscr"),
    StringValue(PAYMENT_GROUP,
                'BUSINESS',
                description=_('Paypal account email'),
                help_text=_('The email address for your paypal account'),
                default=""),
    StringValue(
        PAYMENT_GROUP,
Exemplo n.º 25
0
from livesettings.functions import config_register_list
from livesettings.values import ConfigurationGroup, StringValue, BooleanValue, \
    ModuleValue
from django.utils.translation import ugettext_lazy as _

PAYMENT_GROUP = ConfigurationGroup('PAYMENT_CONCARDIS',
                                   _('Concardis Payment Module Settings'),
                                   ordering=101)

config_register_list(
    StringValue(PAYMENT_GROUP,
                'CURRENCY_CODE',
                description=_('Currency Code'),
                help_text=_('Currency code for Concardis transactions.'),
                default='EUR'),
    StringValue(
        PAYMENT_GROUP,
        'SHA_IN_PASSPHRASE',
        description=_('SHA-IN pass phrase'),
        help_text=_('The SHA-IN pass phrase used to hash the parameters.'),
        default=''),
    StringValue(
        PAYMENT_GROUP,
        'SHA_OUT_PASSPHRASE',
        description=_('SHA-OUT pass phrase'),
        help_text=_('The SHA-OUT pass phrase used to hash the parameters.'),
        default=''),
    StringValue(
        PAYMENT_GROUP,
        'POST_URL',
        description=_('Post URL'),
Exemplo n.º 26
0
from livesettings.functions import config_register_list, config_get
SHIP_MODULES = config_get('SHIPPING', 'MODULES')
SHIP_MODULES.add_choice(
    ('shipping.modules.fedex_web_services', 'FEDEX (fedex_web_services)'))

SHIPPING_GROUP = ConfigurationGroup(
    'shipping.modules.fedex_web_services',
    _('FedEx Web Services Shipping Settings'),
    requires=SHIP_MODULES,
    requiresvalue='shipping.modules.fedex_web_services',
    ordering=101)

config_register_list(
    StringValue(SHIPPING_GROUP,
                'METER_NUMBER',
                description=_('FedEx Meter Number'),
                help_text=_('Meter Number provided by FedEx.'),
                default=''),
    StringValue(SHIPPING_GROUP,
                'ACCOUNT',
                description=_('FedEx Account Number'),
                help_text=_('FedEx Account Number.'),
                default=''),
    StringValue(SHIPPING_GROUP,
                'AUTHENTICATION_KEY',
                description=_('FedEx Authentication Key'),
                help_text=_('FedEx Authentication Key.'),
                default=''),
    StringValue(SHIPPING_GROUP,
                'AUTHENTICATION_PASSWORD',
                description=_('FedEx Authentication Password'),
Exemplo n.º 27
0
              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(
     PAYMENT_GROUP,
     'CAPTURE',
     description=_('Payment Capture'),
     help_text=
     _('This can be "Payment" which captures immediately, or "Deferred".  Note that you can only use the latter if you set option on your Sage pay account first.'
       ),
     choices=(
         (('PAYMENT', 'Payment')),
         (('DEFERRED', 'Deferred')),
     ),
     default='PAYMENT'),
 ModuleValue(PAYMENT_GROUP,
             'MODULE',
             description=_('Implementation module'),
             hidden=True,
             default='payment.modules.sagepay'),
 StringValue(PAYMENT_GROUP,
             'KEY',
             description=_("Module key"),
             hidden=True,
             default='SAGEPAY'),
Exemplo n.º 28
0
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 _

PAYMENT_GROUP = ConfigurationGroup('PAYMENT_GIFTCERTIFICATE',
                                   _('Gift Certificate Settings'))

config_register_list(
    StringValue(
        PAYMENT_GROUP,
        'CHARSET',
        description=_("Character Set"),
        default="BCDFGHKPRSTVWXYZbcdfghkprstvwxyz23456789",
        help_text=
        _("The characters allowable in randomly-generated certficate codes.  No vowels means no unfortunate words."
          )),
    StringValue(PAYMENT_GROUP,
                'KEY',
                description=_("Module key"),
                hidden=True,
                default='GIFTCERTIFICATE'),
    StringValue(
        PAYMENT_GROUP,
        'FORMAT',
        description=_('Code format'),
        default="^^^^-^^^^-^^^^",
        help_text=
        _("Enter the format for your cert code.  Use a '^' for the location of a randomly generated character."
          )),
    ModuleValue(PAYMENT_GROUP,
                'MODULE',
Exemplo n.º 29
0
MODERATION = ConfigurationGroup('MODERATION',
                                _('Content moderation'),
                                super_group=DATA_AND_FORMATTING)

CONTENT_MODERATION_MODE_CHOICES = (
    ('flags', _('audit flagged posts')),
    ('audit', _('audit flagged posts and watched users')),
    ('premoderation', _('pre-moderate watched users and audit flagged posts')),
)

settings.register(
    StringValue(
        MODERATION,
        'CONTENT_MODERATION_MODE',
        choices=CONTENT_MODERATION_MODE_CHOICES,
        default='flags',
        description=_('Content moderation method'),
        help_text=_(
            "Audit is made after the posts are published, pre-moderation "
            "prevents publishing before moderator's decision.")))

settings.register(
    LongStringValue(MODERATION,
                    'FORBIDDEN_PHRASES',
                    default='',
                    description=_('Reject all posts with these phrases'),
                    help_text=_(
                        'Enter one phrase per line (case-insensitive). '
                        'Posts with these phrases will be rejected '
                        'without moderation.')))
Exemplo n.º 30
0
from livesettings.values import StringValue, ConfigurationGroup, BooleanValue, ModuleValue
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_GOOGLE',
                                   _('Google Checkout Module Settings'),
                                   ordering=101)

config_register_list(
    StringValue(
        PAYMENT_GROUP,
        'CART_XML_TEMPLATE',
        description=_("XML Template"),
        help_text=
        _("The XML template to use when submitting to Google. Probably you should not change this."
          ),
        default="shop/checkout/google/cart.xml"),
    StringValue(PAYMENT_GROUP,
                'CURRENCY_CODE',
                description=_('Currency Code'),
                help_text=_('Currency code for Google Checkout transactions.'),
                default='USD'),
    StringValue(PAYMENT_GROUP,
                'CHECKOUT_BUTTON_URL',
                description=_('Checkout Button URL'),
                default="http://checkout.google.com/buttons/checkout.gif"),
    StringValue(PAYMENT_GROUP,
                'CHECKOUT_BUTTON_SIZE',
                description=_('Checkout Button Size'),