Пример #1
0
Файл: config.py Проект: 34/T
from livesettings import ConfigurationGroup, config_register_list, 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)
)
Пример #2
0
Файл: config.py Проект: 34/T
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(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."),
        default=True
    ),
    
    BooleanValue(PRODUCT_GROUP,
        'SHOW_NO_PHOTO_IN_CATEGORY',
        description=_("Display Photo Not Available Image in the category page?"),
        help_text=_("If yes, then a Photo Not Available Image will be shown on the category page."),
        default=False
    ),
)
Пример #3
0
config_register_list(
    StringValueWidget(
        EMAIL_GROUP,
        'DEFAULT_FROM_EMAIL',
        description=_('Email'),
        ordering=0,
        default='*****@*****.**',
        help_text=_('Default email address'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'EMAIL_SUBJECT_PREFIX',
        description=_('Prefix'),
        ordering=1,
        default='[exmo] ',
        help_text=_('Email subject prefix'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'NOTIFY_LIST_INTERACTION',
        description=_('Email'),
        ordering=2,
        default='*****@*****.**',
        help_text=_('Notify list interaction'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'NOTIFY_LIST_REPORT',
        description=_('Email'),
        ordering=3,
        default='*****@*****.**',
        help_text=_('Notify list report'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'DEFAULT_SUPPORT_EMAIL',
        description=_('Email'),
        ordering=0,
        default='*****@*****.**',
        help_text=_('Default support email address'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'CERTIFICATE_ORDER_NOTIFICATION_EMAIL',
        description=_('Email'),
        ordering=5,
        default='*****@*****.**',
        help_text=_('Certificate order notification email'),
    ),
)
Пример #4
0
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),
    StringValue(THUMB_GROUP, 
        'IMAGE_SMALL_SIZE', 
        description= _("Thumbnail Small size"), 
        help_text = _("The width/height of the thumbnail small image. [width]x[height]"),
        default="85x85",
        ordering=0),
    StringValue(THUMB_GROUP, 
        'IMAGE_LARGE_SIZE', 
        description= _("Thumbnail Large size"), 
        help_text = _("The width/height of the thumbnail large image. [width]x[height]"),
        default="280x280",
        ordering=0),
        
    BooleanValue(THUMB_GROUP,
        'RENAME_IMAGES',
        description=_("Rename product images?"),
        help_text=_("Automatically rename product images on upload?"),
        default=True)
)
Пример #5
0
from livesettings import ConfigurationGroup, config_register_list, 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))
Пример #6
0
config_register_list(

    # Texbox - string or many other types
    StringValue( GR1_BOX, 'my_StringValue', description='Textbox', ordering=1, default='Orange',
        help_text='StringValue and many different types looks similar'),

    # Textarea - LongStringValue can be longer then 255 characters
    LongStringValue( GR1_BOX, 'my_LongStringValue', description='Textarea', ordering=2, default='something',
        help_text='Long String value'),

    # Checkbox - Boolean
    BooleanValue( GR1_BOX, 'my_BooleanValue', description='Check box',  ordering=3, default=True,
        help_text='Boolean value'),

    # Combobox - String value with choices
    StringValue( GR1_BOX, 'my_StringValue_combobox', description='Combobox', ordering=4,
         help_text='String value with choices',
         default=u'AUTO',
         choices=(('ELEPHANT', _('Elephant')), ('ANT', _('Ant')), ('AUTO', _('Autodetect')),)),

    # Listbox with multiple selection - MultipleStringValue with choices
    MultipleStringValue( GR1_BOX, 'my_MultipleStringValue', 
        description='Listbox - e.g. Required Fields', ordering=5, help_text='MultipleStringValue with choices',
        default=['email', 'first_name'],
        choices=(
            ('email', _("Email")),
            ('title', _("Title")),
            ('first_name', _("First name")),
            ('last_name', _("Last name")),
        )),

    # Password displayed like '****'.
    PasswordValue( GR1_BOX, 'my_PasswordValue', description='Password value', ordering=6,
        default='only to see *** now', render_value=True),
    # If render_value=True (default) the widget will be pre-filled with an actual password value displayed like "****".
    # If render_value=False, the password field is not pre-filled with any value
    # and an actual value can be removed by writing space to the field (which is converted to empty string).

)
Пример #7
0
config_register_list(
    StringValueWidget(
        EMAIL_GROUP,
        "DEFAULT_FROM_EMAIL",
        description=_("Email"),
        ordering=0,
        default="*****@*****.**",
        help_text=_("Default email address"),
    ),
    StringValueWidget(
        EMAIL_GROUP,
        "EMAIL_SUBJECT_PREFIX",
        description=_("Prefix"),
        ordering=1,
        default="[exmo] ",
        help_text=_("Email subject prefix"),
    ),
    StringValueWidget(
        EMAIL_GROUP,
        "DEFAULT_SUPPORT_EMAIL",
        description=_("Email"),
        ordering=2,
        default="*****@*****.**",
        help_text=_("Default support email address"),
    ),
    StringValueWidget(
        EMAIL_GROUP,
        "NOTIFY_LIST_REPORT",
        description=_("Email"),
        ordering=3,
        default="*****@*****.**",
        help_text=_("Notify list report"),
    ),
    StringValueWidget(
        EMAIL_GROUP,
        "CERTIFICATE_ORDER_NOTIFICATION_EMAIL",
        description=_("Email"),
        ordering=4,
        default="*****@*****.**",
        help_text=_("Certificate order notification email"),
    ),
)
Пример #8
0
# coding=utf-8
from livesettings.values import *
from django.utils.translation import ugettext_lazy as _
from livesettings import config_register_list

SITE_GROUP = ConfigurationGroup('template_blocks', _('Site Settings'), ordering=0)
config_register_list(
    LongStringValue(SITE_GROUP, 'title', description=_('Title'), ordering=1),
    LongStringValue(SITE_GROUP, 'meta_description', description=_('Meta Description'), ordering=1),
    LongStringValue(SITE_GROUP, 'meta_keywords', description=_('Meta Keywords'), ordering=1),
    LongStringValue(SITE_GROUP, 'footer', description=_('Footer'), ordering=1, default=""),

    PositiveIntegerValue(SITE_GROUP, 'refresh_interval_slider', description=_('Refresh Interval Slider'), default=1000),
)

'''
STORE_GROUP = ConfigurationGroup('store_groups', _('Store Settings'), ordering=0)
config_register_list(
    LongStringValue(STORE_GROUP, 'title', description=_('Title'), ordering=1),
    LongStringValue(STORE_GROUP, 'description', description=_('Description'), ordering=2),
    LongStringValue(STORE_GROUP, 'address', description=_('Address'), ordering=3),
    #LongStringValue(STORE_GROUP, 'meta_keywords', description=_('Meta Keywords'), ordering=1),
    #LongStringValue(SITE_GROUP, 'footer', description=_('Footer'), ordering=1, default=""),
)'''
Пример #9
0
config_register_list(
    StringValueWidget(
        EMAIL_GROUP,
        'DEFAULT_FROM_EMAIL',
        description=_('Email'),
        ordering=0,
        default='*****@*****.**',
        help_text=_('Default email address'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'EMAIL_SUBJECT_PREFIX',
        description=_('Prefix'),
        ordering=1,
        default='[exmo] ',
        help_text=_('Email subject prefix'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'DEFAULT_SUPPORT_EMAIL',
        description=_('Email'),
        ordering=2,
        default='*****@*****.**',
        help_text=_('Default support email address'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'NOTIFY_LIST_REPORT',
        description=_('Email'),
        ordering=3,
        default='*****@*****.**',
        help_text=_('Notify list report'),
    ),

    StringValueWidget(
        EMAIL_GROUP,
        'CERTIFICATE_ORDER_NOTIFICATION_EMAIL',
        description=_('Email'),
        ordering=4,
        default='*****@*****.**',
        help_text=_('Certificate order notification email'),
    ),
)
Пример #10
0
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 '
                    'made when the order is marked as shipped.')),

    StringValue(PAYMENT_GROUP,
        'KEY',
        description=_("Module key"),
        hidden=True,
        default = 'PAYFLOWPRO'),

    StringValue(PAYMENT_GROUP,
        'LABEL',
        description=_('English name for this group on the checkout screens'),
        default = 'Credit Cards',
        dummy = _('Credit Cards'), # 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'),
        default = r'^credit/'),

    MultipleStringValue(
        PAYMENT_GROUP,
        'CREDITCHOICES',
        description=_('Available credit cards'),
        choices = (
            (('American Express', 'American Express')),
            (('Visa','Visa')),
            (('Mastercard','Mastercard')),
            (('Discover','Discover')),
            (('Diners Club', 'Diners Club')),
            (('JCB', 'JCB')),
            ),
        default = ('Visa', 'Mastercard')),
    
    StringValue(PAYMENT_GROUP,
        'PARTNER',
        description=_("Your authorized PayPal reseller's id."),
        default="PayPal"),

    StringValue(PAYMENT_GROUP,
        'VENDOR',
        description=_("Your merchant login ID that you created when you "
                      "registered for the account."),
        default="VENDOR_ID"),

    StringValue(PAYMENT_GROUP,
        'USER',
        description=_("If you set up more additional users on the PayPal "
                      "account, this value is the ID of the user authorized to "
                      "process transactions. If you have not set up additional "
                      "users on the account, has the same value as VENDOR."),
        default="VENDOR_ID"),

    StringValue(
        PAYMENT_GROUP,
        'PASSWORD',
        description=_("Your PayflowPro account password"),
        default=""),

    #BooleanValue(PAYMENT_GROUP,
        #'CAPTURE',
        #description=_('Capture Payment immediately?'),
        #default=True,
        #help_text=_('IMPORTANT: If false, a capture attempt will be made when '
        #            'the order is marked as shipped.')),

    BooleanValue(PAYMENT_GROUP,
        'EXTRA_LOGGING',
        description=_("Verbose logs"),
        help_text=_("Add extensive logs during post."),
        default=False)
    )
Пример #11
0
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 '
                             'made when the order is marked as shipped.')),
    StringValue(PAYMENT_GROUP,
                'KEY',
                description=_("Module key"),
                hidden=True,
                default='PAYFLOWPRO'),
    StringValue(
        PAYMENT_GROUP,
        'LABEL',
        description=_('English name for this group on the checkout screens'),
        default='Credit Cards',
        dummy=_('Credit Cards'),  # 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'),
                default=r'^credit/'),
    MultipleStringValue(PAYMENT_GROUP,
                        'CREDITCHOICES',
                        description=_('Available credit cards'),
                        choices=(
                            (('American Express', 'American Express')),
                            (('Visa', 'Visa')),
                            (('Mastercard', 'Mastercard')),
                            (('Discover', 'Discover')),
                            (('Diners Club', 'Diners Club')),
                            (('JCB', 'JCB')),
                        ),
                        default=('Visa', 'Mastercard')),
    StringValue(PAYMENT_GROUP,
                'PARTNER',
                description=_("Your authorized PayPal reseller's id."),
                default="PayPal"),
    StringValue(PAYMENT_GROUP,
                'VENDOR',
                description=_(
                    "Your merchant login ID that you created when you "
                    "registered for the account."),
                default="VENDOR_ID"),
    StringValue(PAYMENT_GROUP,
                'USER',
                description=_(
                    "If you set up more additional users on the PayPal "
                    "account, this value is the ID of the user authorized to "
                    "process transactions. If you have not set up additional "
                    "users on the account, has the same value as VENDOR."),
                default="VENDOR_ID"),
    StringValue(PAYMENT_GROUP,
                'PASSWORD',
                description=_("Your PayflowPro account password"),
                default=""),

    #BooleanValue(PAYMENT_GROUP,
    #'CAPTURE',
    #description=_('Capture Payment immediately?'),
    #default=True,
    #help_text=_('IMPORTANT: If false, a capture attempt will be made when '
    #            'the order is marked as shipped.')),
    BooleanValue(PAYMENT_GROUP,
                 'EXTRA_LOGGING',
                 description=_("Verbose logs"),
                 help_text=_("Add extensive logs during post."),
                 default=False))
Пример #12
0
config_register_list(

    # Texbox - string or many other types
    StringValue( GR1_BOX, 'my_StringValue', description='Textbox', ordering=1, default='Orange',
        help_text='StringValue and many different types looks similar'),

    # Textarea - LongStringValue can be longer then 255 characters
    LongStringValue( GR1_BOX, 'my_LongStringValue', description='Textarea', ordering=2, default='something',
        help_text='Long String value'),

    # Checkbox - Boolean
    BooleanValue( GR1_BOX, 'my_BooleanValue', description='Check box',  ordering=3, default=True,
        help_text='Boolean value'),

    # Combobox - String value with choices
    StringValue( GR1_BOX, 'my_StringValue_combobox', description='Combobox', ordering=4,
         help_text='String value with choices',
         default=u'AUTO',
         choices=(('ELEPHANT', _('Elephant')), ('ANT', _('Ant')), ('AUTO', _('Autodetect')),)),

    # Listbox with multiple selection - MultipleStringValue with choices
    MultipleStringValue( GR1_BOX, 'my_MultipleStringValue', 
        description='Listbox - e.g. Required Fields', ordering=5, help_text='MultipleStringValue with choices',
        default=['email', 'first_name'],
        choices=(
            ('email', _("Email")),
            ('title', _("Title")),
            ('first_name', _("First name")),
            ('last_name', _("Last name")),
        )),

    # Password displayed like '****'.
    PasswordValue( GR1_BOX, 'my_PasswordValue', description='Password value', ordering=6,
        default='only to see *** now', render_value=True),
    # If render_value=True (default) the widget will be pre-filled with an actual password value displayed like "****".
    # If render_value=False, the password field is not pre-filled with any value
    # and an actual value can be removed by writing space to the field (which is converted to empty string).

)
Пример #13
0
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(
        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."),
        default=True),
    BooleanValue(
        PRODUCT_GROUP,
        'SHOW_NO_PHOTO_IN_CATEGORY',
        description=_(
            "Display Photo Not Available Image in the category page?"),
        help_text=
        _("If yes, then a Photo Not Available Image will be shown on the category page."
          ),
        default=False),
)