Example #1
0
    def register(self, value):
        """registers the setting
        value must be a subclass of livesettings.Value
        """
        key = value.key
        group_key = value.group.key

        ordering = self.__ordering_index.get(group_key, None)
        if ordering:
            ordering += 1
            value.ordering = ordering
        else:
            ordering = 1
            value.ordering = ordering
        self.__ordering_index[group_key] = ordering

        if key not in self.__instance:
            self.__instance[key] = config_register(value)
            self.__group_map[key] = group_key
    def make_field(self, **kwargs):
        validators = kwargs.setdefault('validators', [])
        validators.append(validate_email)
        return super(EmailValue, self).make_field(**kwargs)


SHOP_CONFIG = ConfigurationGroup(
    'SHOP_CONFIG',
    _(u'Shop configuration'),
    ordering=0)

config_register(
    StringValue(
        SHOP_CONFIG,
        'SHOP_NAME',
        description=_(u'Shop name'),
        help_text=_(u'The name of the site, shown on all pages and mails'),
        default=u"Sho Name"))

config_register(
    IBANValue(
        SHOP_CONFIG,
        'IBAN',
        description=_(u'IBAN'),
        help_text=_(u'your bank account code: fill in if you have chosen '
                    u'to accept payments via bank transfer'),
        default=u''))

config_register(
    StringValue(
Example #3
0
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, PercentValue, StringValue
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup(
    'MyApp',               # key: internal name of the group to be created
    u'Настройки сайта',  # name: verbose name which can be automatically translated
    ordering=0             # ordering: order of group in the list (default is 1)
    )



config_register(StringValue(
                            MYAPP_GROUP,
        'EMAIL', 
        description = u'Email администратора',
        help_text = u"Почта, куда будут приходить заявки.",
        default = '*****@*****.**'
    ))

config_register(StringValue(
                            MYAPP_GROUP,
        'PHONE', 
        description = u'Телефон',
        help_text = u"Для отображения на сайте",
        default = '8 (926) 555-55-55'
    ))

config_register(StringValue(
                            MYAPP_GROUP,
        'ORDERS_COUNT', 
Example #4
0
from livesettings import config_register, ConfigurationGroup, values


EVENTS_GROUP = ConfigurationGroup('Events', 'Settings for events app')
EVENTS_MAP_GROUP = ConfigurationGroup('EventsMap', 'Settings for events map')

config_register(values.BooleanValue(
    EVENTS_GROUP,
    'supporters-autonotify',
    description="Should event's supporters be notified automatically on new event's updates or not",
    default=True
))

config_register(values.PositiveIntegerValue(
    EVENTS_MAP_GROUP,
    'operator-wake-up-alert-interval',
    description='Time for operator alert in minutes',
    default=7
))
config_register(values.BooleanValue(
    EVENTS_MAP_GROUP,
    'newevent-highlight',
    description='Should new events be highlighted or not',
    default=True
))
config_register(values.BooleanValue(
    EVENTS_MAP_GROUP,
    'newevent-sound',
    description='Should page play sound on new event or not',
    default=True
))
Example #5
0
from livesettings import config_register, 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', _("Last name")),
        ('phone', _("Phone")),
        ('addressee', _("Addressee")),
Example #6
0
BILLING_GROUP = ConfigurationGroup('BILLING',
                                   _('Billing Settings'),
                                   ordering=0)

SERVER_MODULES = config_get('SERVER', 'MODULES')
SERVER_MODULES.add_choice(('nibblebill', _('Billings')))
SERVER_MODULES.add_choice(('nibblebill', _('Billings')))

##SERVER_GROUP = ConfigurationGroup('xml_cdr',
##    _('CDR XML Module Settings'),
##    requires=SERVER_MODULES,
##    ordering = 104)

config_register(
    DecimalValue(
        BILLING_GROUP,
        'BALANCE_CASH',
        description=_('Beginning balance'),
        help_text=_(
            "The initial balance in the new user registration such as 0.25 USD"
        ),
        default=Decimal('0.25')))

config_register(
    PositiveIntegerValue(
        BILLING_GROUP,
        'BALANCE_TARIFF',
        description=_('Default tariff'),
        help_text=_("Make sure to create a tariff in the tariff plan"),
        default=1))
Example #7
0
# -*- coding: utf-8 -*-

from livesettings import (config_register, ConfigurationGroup,
                          PositiveIntegerValue, StringValue)
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
SHOP_GROUP = ConfigurationGroup('shop', _('Shop Settings'), ordering=0)

# Now, add our number of images to display value
# If a user doesn't enter a value, default to 5
config_register(StringValue(
    SHOP_GROUP,
    'MOST_DISCOUNT_CIGARETTE',
    description = u'Самое выгодное предложение',
    help_text = u'Укажите метку сигареты (можно посмотреть на странице'
                u' редактирования сигареты',
    default = 'turbo-white'
))
config_register(StringValue(
    SHOP_GROUP,
    'MOST_POPULAR_CIGARETTE',
    description = u'Самая популярная сигарета',
    help_text = u'Укажите метку сигареты (можно посмотреть на странице'
                u' редактирования сигареты',
    default = 'black'
))
config_register(StringValue(
    SHOP_GROUP,
    'BEST_MALE_CIGARETTE',
    description = u'Лучшая мужская сигарета',
Example #8
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see 
# http://www.gnu.org/licenses/agpl-3.0.html.

from django.contrib import admin
from videos.models import Video, SubtitleLanguage, SubtitleVersion, Subtitle
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from utils.livesettings_values import EmailListValue
from livesettings import BASE_GROUP, config_register

config_register(EmailListValue(BASE_GROUP, 'alert_emails', description=_(u'Email for alert')))

class VideoAdmin(admin.ModelAdmin):
    actions = None
    list_display = ['__unicode__', 'title', 'languages', 'video_thumbnail']
    search_fields = ['video_id', 'title', 'videourl__url', 'user__username']
    
    def video_thumbnail(self, obj):
        return '<img width="50" height="50" src="%s"/>' % obj.get_small_thumbnail() 
    
    video_thumbnail.allow_tags = True
    video_thumbnail.short_description = 'Thumbnail'
    
    def languages(self, obj):
        lang_qs = obj.subtitlelanguage_set.all()
        link_tpl = '<a href="%s">%s</a>'
Example #9
0
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, MultipleStringValue, ModuleValue
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup('MyApp', _('My App Settings'), ordering=0)

# Now, add our number of images to display value
# If a user doesn't enter a value, default to 5
config_register(
    PositiveIntegerValue(
        MYAPP_GROUP,
        'NUM_IMAGES',
        description=_('Number of images to display'),
        help_text=_("How many images to display on front page."),
        default=5))

# Another example of allowing the user to select from several values
config_register(
    MultipleStringValue(MYAPP_GROUP,
                        'MEASUREMENT_SYSTEM',
                        description=_("Measurement System"),
                        help_text=_("Default measurement system to use."),
                        choices=[('metric', _('Metric')),
                                 ('imperial', _('Imperial'))],
                        default="imperial"))

config_register(
    ModuleValue(
        MYAPP_GROUP,
        'MODULE',
        #description=_("Measurement System"),
Example #10
0
# -*- coding: utf-8 -*-
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, PercentValue, StringValue
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup(
    'MyApp',  # key: internal name of the group to be created
    u'Настройки сайта',  # name: verbose name which can be automatically translated
    ordering=0  # ordering: order of group in the list (default is 1)
)

config_register(
    StringValue(MYAPP_GROUP,
                'EMAIL',
                description=u'Email администратора',
                help_text=u"Почта, куда будут приходить заявки.",
                default='*****@*****.**'))

config_register(
    StringValue(MYAPP_GROUP,
                'PHONE',
                description=u'Телефон',
                default='+7(495) 969 88 69'))
Example #11
0
from decimal import Decimal
from django.utils.translation import ugettext_lazy as _
from livesettings import (config_register, ConfigurationGroup, DecimalValue,
                          StringValue)

BANNERS_INFO = ConfigurationGroup('BANNERS_INFO',
                                  _(u'Banners info'),
                                  ordering=0)

config_register(
    DecimalValue(BANNERS_INFO,
                 'NUM_MAX',
                 description=_(u'Offers in splash page'),
                 help_text=_(
                     u"sets the maximum number of offers to be shown in the "
                     u"splash page"),
                 default=Decimal('3')))

# SOCIALS_INFO configs
SOCIALS_INFO = ConfigurationGroup('SOCIALS_INFO',
                                  _('Socials urls info'),
                                  ordering=0)

# facebook
config_register(
    StringValue(
        SOCIALS_INFO,
        'FACEBOOK_URL',
        description=_(u'Facebook url'),
        help_text=_(u"Insert personal facebook url"),
        default="",
Example #12
0
# -*- coding: utf-8 -*-
from livesettings import config_register, ConfigurationGroup, IntegerValue
from django.utils.translation import ugettext_lazy as _


# Shop configs
INVITES_SETTINGS = ConfigurationGroup(
    'INVITES_SETTINGS',
    _(u'Invites settings'),
    ordering=1)


config_register(
    IntegerValue(
        INVITES_SETTINGS,
        'MAX_INVITES',
        description=_(u'Maximum invites'),
        help_text=_(u"The maximum number of invites a user can send"),
        default=10))
Example #13
0
# -*- coding: utf-8 -*-
from livesettings import config_register, ConfigurationGroup, StringValue
from django.utils.translation import ugettext_lazy as _

from product.models import Category

from .utils import ModelValue

# GIFT_INFO configs
GIFT_INFO = ConfigurationGroup('GIFT_INFO',
                               _('Gift configurations'),
                               ordering=0)

# Codice univoco
config_register(
    StringValue(GIFT_INFO,
                'LABEL',
                description=_('Label for gift orders annotation'),
                help_text="",
                default="Is a gift."))

# Gift category
config_register(
    ModelValue(GIFT_INFO,
               'GIFT_CATEGORY',
               description=_(u'Gift Category'),
               help_text=_(u"Choose which category contains gift products"),
               queryset=Category.objects.all(),
               required=False))
Example #14
0
#!/usr/bin/env python

from livesettings import config_register, BooleanValue, ConfigurationGroup, FloatValue, PositiveIntegerValue, StringValue
from django.utils.translation import ugettext_lazy as _

# Site domain settings
DOMAIN_GROUP = ConfigurationGroup(
    'DOMAIN',
    _('Site domain'),
    ordering=0
)

config_register(StringValue(
    DOMAIN_GROUP,
    'SITE_DOMAIN',
    description=_('Site domain to be referenced in outgoing email.'),
    default='localhost:8000'
))

# Email settings
EMAIL_GROUP = ConfigurationGroup(
    'EMAIL',
    _('Email'),
    ordering=1
)

config_register(BooleanValue(
    EMAIL_GROUP,
    'EMAIL_ENABLED',
    description=_('Enable email?'),
    help_text=_('If enabled, notifications and activation messages will be sent via email.'),
Example #15
0
File: config.py Project: 34/T
# -*- coding: utf-8 -*-

from django.utils.translation import ugettext_lazy as _
from livesettings import ConfigurationGroup, StringValue, config_register

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

config_register(
    StringValue(PRODUCT_GROUP,
        'PROTECTED_DIR',
        description=_("Protected dir"),
        help_text=_("""This is only used if you use Downloadable Products.
This value will be appended to MEDIA_ROOT/MEDIA_URL.  Do not worry about slashes.
We can handle it any which way."""),
        default="protected",
    ))
Example #16
0
# -*- coding: utf-8 -*-
from decimal import Decimal
from livesettings import (config_register, ConfigurationGroup,
                                    StringValue, DecimalValue)
from django.utils.translation import ugettext_lazy as _


# ZONES_INFO configs
ZONES_INFO = ConfigurationGroup(
    'ZONES_INFO',
    _('Configurations for Zones'),
    ordering=0
)

# max_days
config_register(
    DecimalValue(
        ZONES_INFO,
        'MAX_DAYS',
        description=_('Max days for stale shipments'),
        help_text="",
        default=Decimal('1'),
    )
)
Example #17
0
#pylint: disable=E1102
#        '_ is not callable'
from livesettings import config_register, ConfigurationGroup, StringValue, \
    BooleanValue, PasswordValue, IntegerValue
from django.utils.translation import ugettext_lazy as _

RECEIVEMAIL_GROUP = ConfigurationGroup(
    'ReceiveMail',               # key: internal name of the group to be created
    _('Receiving email Settings (POP3)'),  # name: verbose name which can be automatically translated
    ordering=0             # ordering: order of group in the list (default is 1)
    )

config_register(StringValue(
    RECEIVEMAIL_GROUP,           # group: object of ConfigurationGroup created above
        'USERNAME',      # key:   internal name of the configuration value to be created
        description = _('Username'),              # label for the value
        help_text = _("Enter the Username used to access the email account."),  # help text
        ordering = 0
    ))

config_register(PasswordValue(
    RECEIVEMAIL_GROUP,
        'PASSWORD',
        description='Password',
        help_text='Enter the password to access this mail account.',
        render_value=True,
        ordering = 1
    ))

config_register(StringValue(
    RECEIVEMAIL_GROUP,
Example #18
0
from decimal import Decimal
from django.utils.translation import ugettext_lazy as _
from livesettings import config_register, ConfigurationGroup, DecimalValue, StringValue


BANNERS_INFO = ConfigurationGroup("BANNERS_INFO", _(u"Banners info"), ordering=0)

config_register(
    DecimalValue(
        BANNERS_INFO,
        "NUM_MAX",
        description=_(u"Offers in splash page"),
        help_text=_(u"sets the maximum number of offers to be shown in the " u"splash page"),
        default=Decimal("3"),
    )
)

# SOCIALS_INFO configs
SOCIALS_INFO = ConfigurationGroup("SOCIALS_INFO", _("Socials urls info"), ordering=0)

# facebook
config_register(
    StringValue(
        SOCIALS_INFO,
        "FACEBOOK_URL",
        description=_(u"Facebook url"),
        help_text=_(u"Insert personal facebook url"),
        default="",
    )
)
Example #19
0
from django.utils.translation import ugettext_lazy as _


# LINKEDIN APP KEY/SECRET configs
LINKEDIN_INFO = ConfigurationGroup(
    'LINKEDIN_INFO',
    _('LinkedIn info'),
    ordering=0
)

# key
config_register(
    StringValue(
        LINKEDIN_INFO,
        'KEY',
        description=_('Key'),
        help_text="Insert you linkedin app key",
        default="",
    )
)

# secret
config_register(
    StringValue(
        LINKEDIN_INFO,
        'SECRET',
        description=_('Secret'),
        help_text="Insert you linkedin app secret",
        default="",
    )
)
Example #20
0
# -*- coding: utf-8 -*-

from django.utils.translation import ugettext_lazy as _
from livesettings import ConfigurationGroup, PositiveIntegerValue, MultipleStringValue, StringValue, BooleanValue, 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(
        PRODUCT_GROUP,
Example #21
0
class EmailValue(StringValue):
    def make_field(self, **kwargs):
        validators = kwargs.setdefault('validators', [])
        validators.append(validate_email)
        return super(EmailValue, self).make_field(**kwargs)


SHOP_CONFIG = ConfigurationGroup('SHOP_CONFIG',
                                 _(u'Shop configuration'),
                                 ordering=0)

config_register(
    StringValue(
        SHOP_CONFIG,
        'SHOP_NAME',
        description=_(u'Shop name'),
        help_text=_(u'The name of the site, shown on all pages and mails'),
        default=u"Sho Name"))

config_register(
    IBANValue(SHOP_CONFIG,
              'IBAN',
              description=_(u'IBAN'),
              help_text=_(
                  u'your bank account code: fill in if you have chosen '
                  u'to accept payments via bank transfer'),
              default=u''))

config_register(
    StringValue(SHOP_CONFIG,
Example #22
0
# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup(
    'MyApp',  # key: internal name of the group to be created
    _('My App Settings'
      ),  # name: verbose name which can be automatically translated
    ordering=0  # ordering: order of group in the list (default is 1)
)

# Now, add our number of images to display value
# If a user doesn't enter a value, default to 5
config_register(
    PositiveIntegerValue(
        MYAPP_GROUP,  # group: object of ConfigurationGroup created above
        'NUM_IMAGES',  # key:   internal name of the configuration value to be created
        description=_('Number of images to display'),  # label for the value
        help_text=_("How many images to display on front page."),  # help text
        default=
        5  # value used if it have not been modified by the user interface
    ))

# Another example of allowing the user to select from several values
config_register(
    MultipleStringValue(MYAPP_GROUP,
                        'MEASUREMENT_SYSTEM',
                        description=_("Measurement System"),
                        help_text=_("Default measurement system to use."),
                        choices=[('metric', _('Metric')),
                                 ('imperial', _('Imperial'))],
                        default="imperial"))
Example #23
0
import os
from livesettings import config_register, ConfigurationGroup, StringValue
from django.utils.translation import ugettext_lazy as _
from django.conf import settings

def _get_themes():
        s_path = settings.TEMPLATE_DIRS[0]
        result = os.listdir(s_path)
        result.remove('zero')
        return [(x,x) for x in result]

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup(
    'landing',               # key: internal name of the group to be created
    _('Landing Config'),  # name: verbose name which can be automatically translated
    ordering=0             # ordering: order of group in the list (default is 1)
    )

config_register(StringValue(
        MYAPP_GROUP,
        'THEME',
        description=_("Theme For The Web"),
        help_text=_("Default Theme."),
        choices=_get_themes(),
        default=_get_themes()[0][1]
    ))
Example #24
0
File: config.py Project: eob/panda
#!/usr/bin/env python

from livesettings import config_register, BooleanValue, ConfigurationGroup, PositiveIntegerValue, StringValue

# Site domain settings
DOMAIN_GROUP = ConfigurationGroup(
    'DOMAIN',
    'Site domain settings',
    ordering=0
)

config_register(StringValue(
    DOMAIN_GROUP,
    'SITE_DOMAIN',
    description='Site domain to be referenced in outgoing email.',
    default='localhost:8000'
))

# Email settings
EMAIL_GROUP = ConfigurationGroup(
    'EMAIL',
    'Email settings',
    ordering=1
)

config_register(StringValue(
    EMAIL_GROUP,
    'EMAIL_HOST',
    description='Hostname or IP of the SMTP server.',
    default='localhost',
    ordering=0
Example #25
0
from django.utils.translation import ugettext_lazy as _

# First, setup a group to hold all our possible configs
STRIPE_KEYS = ConfigurationGroup(
    # key: internal name of the group to be created
    'jahjahworks',
    # name: verbose name which can be automatically translated
    _('jahjah.works Settings'),
    # ordering: order of group in the list (default is 1)
    ordering=0
)

config_register(BooleanValue(
    STRIPE_KEYS,
    'STRIPE_TEST_MODE',
    description=_("Stripe Test Mode"),
    help_text=_("Stripe Test Mode."),
    default=True
))

config_register(StringValue(
    STRIPE_KEYS,
    'STRIPE_TEST_PUBLIC_KEY',
    description=_("TEST / Stripe Public Key"),
    help_text=_("Default Stripe Public Key to use."),
    default="pk_test_G5YzkYwrHN6zzuXRStGX3kTY"
))

config_register(StringValue(
    STRIPE_KEYS,
    'STRIPE_TEST_SECRET_KEY',
Example #26
0
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, MultipleStringValue
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup(
    'MyApp',               # key: internal name of the group to be created
    _('My App Settings'),  # name: verbose name which can be automatically translated
    ordering=0             # ordering: order of group in the list (default is 1)
    )

# Now, add our number of images to display value
# If a user doesn't enter a value, default to 5
config_register(PositiveIntegerValue(
    MYAPP_GROUP,           # group: object of ConfigurationGroup created above
        'NUM_IMAGES',      # key:   internal name of the configuration value to be created
        description = _('Number of images to display'),              # label for the value
        help_text = _("How many images to display on front page."),  # help text
        default = 5        # value used if it have not been modified by the user interface
    ))

# Another example of allowing the user to select from several values
config_register(MultipleStringValue(
        MYAPP_GROUP,
        'MEASUREMENT_SYSTEM',
        description=_("Measurement System"),
        help_text=_("Default measurement system to use."),
        choices=[('metric',_('Metric')),
                    ('imperial',_('Imperial'))],
        default="imperial"
    ))
Example #27
0
from django.utils.translation import ugettext_lazy as _
from livesettings import config_register, BooleanValue, StringValue, \
    MultipleStringValue, ConfigurationGroup, PositiveIntegerValue, \
    DecimalValue, config_get
    
BILLING_GROUP = ConfigurationGroup('BILLING', _('Billing Settings'), ordering=0)

SERVER_MODULES = config_get('SERVER', 'MODULES')
SERVER_MODULES.add_choice(('nibblebill', _('Billings')))
SERVER_MODULES.add_choice(('nibblebill', _('Billings')))

##SERVER_GROUP = ConfigurationGroup('xml_cdr', 
##    _('CDR XML Module Settings'), 
##    requires=SERVER_MODULES,
##    ordering = 104)

config_register(DecimalValue(
    BILLING_GROUP,
        'BALANCE_CASH',
        description = _('Beginning balance'),
        help_text = _("The initial balance in the new user registration such as 0.25 USD"),
        default = Decimal('0.25')
    ))

config_register(PositiveIntegerValue(
    BILLING_GROUP,
        'BALANCE_TARIFF',
        description = _('Default tariff'),
        help_text = _("Make sure to create a tariff in the tariff plan"),
        default = 1
    ))
Example #28
0
    _('CMS Block'),                # name: verbose name which can be automatically translated
    ordering=0                          # ordering: order of group in the list (default is 1)
    )

#About Us 
config_register(LongStringValue(
    LEAD_GROUP,
    'about_us',
    description = _('about_us :'),
    default = """Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
    ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
    est laborum.
    <br />
    <br />
    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
    incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
    ullamco laboris nisi ut aliquip ex ea commodo consequat.
    Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id
    est laborum.
    <br />
    <br />
    """,
    ordering=0 ))


#How It Works
config_register(LongStringValue(
    LEAD_GROUP,
Example #29
0
SHOP_GROUP = ConfigurationGroup('SHOP', _('Satchmo Shop Settings'), ordering=0)

default_icon_url = urlparse.urlunsplit(
    ('file',
     '',
     os.path.join(settings.MEDIA_ROOT, '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))
    
config_register(DecimalValue(
    SHOP_GROUP,
        'CART_ROUNDING',
        description = _('Cart Quantity Rounding Factor'),
Example #30
0
File: config.py Project: kpx13/vv
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, PercentValue, StringValue
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup(
    'MyApp',               # key: internal name of the group to be created
    u'Настройки сайта',  # name: verbose name which can be automatically translated
    ordering=0             # ordering: order of group in the list (default is 1)
    )



config_register(StringValue(
                            MYAPP_GROUP,
        'EMAIL', 
        description = u'Email администратора',
        help_text = u"Почта, куда будут приходить заявки.",
        default = '*****@*****.**'
    ))

config_register(StringValue(
                            MYAPP_GROUP,
        'CONFERENCE_LINK',
        description = u'Ссылка на следующую конференцию',
        help_text = u"Ссылка, которая будет приходить людям при оплате конференции.",
        default = u'youtube.ru'
    ))
config_register(StringValue(
                            MYAPP_GROUP,
        'CONFERENCE_DATE',
        description = u'Дата следующей конференции',
Example #31
0
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, PercentValue, StringValue
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup(
    "MyApp",  # key: internal name of the group to be created
    u"Настройки сайта",  # name: verbose name which can be automatically translated
    ordering=0,  # ordering: order of group in the list (default is 1)
)


config_register(
    StringValue(
        MYAPP_GROUP,
        "EMAIL",
        description=u"Email администратора",
        help_text=u"Почта, куда будут приходить заявки.",
        default="*****@*****.**",
    )
)

config_register(StringValue(MYAPP_GROUP, "PHONE", description=u"Телефон компании", default="+7 (495) 748-88-27"))


config_register(StringValue(MYAPP_GROUP, "field_1", description=u"доставлен груз до пункта назначения", default="236"))

config_register(StringValue(MYAPP_GROUP, "field_2", description=u"довольных клиентов", default="569"))

config_register(StringValue(MYAPP_GROUP, "field_3", description=u"звонка в день", default="52"))

config_register(StringValue(MYAPP_GROUP, "field_4", description=u"процента закупок за рубежом", default="2,53"))
Example #32
0
from livesettings import config_register, ConfigurationGroup, values


USERS_GROUP = ConfigurationGroup("Users", "Settings for user app")

config_register(
    values.BooleanValue(
        USERS_GROUP,
        "user-moderation",
        description='If flag is active, newly created users will have "is_active" set to False',
        default=False,
    )
)
Example #33
0
SHOP_GROUP = ConfigurationGroup('SHOP', _('Satchmo Shop Settings'), ordering=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 = urlparse.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(
Example #34
0
File: config.py Project: 34/T
# -*- coding: utf-8 -*-

from django.utils.translation import ugettext_lazy as _
from livesettings import ConfigurationGroup, PositiveIntegerValue, MultipleStringValue, StringValue, BooleanValue, 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
    ),
Example #35
0
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, MultipleStringValue, ModuleValue
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup('MyApp', _('My App Settings'), ordering=0)

# Now, add our number of images to display value
# If a user doesn't enter a value, default to 5
config_register(PositiveIntegerValue(
    MYAPP_GROUP,
        'NUM_IMAGES',
        description = _('Number of images to display'),
        help_text = _("How many images to display on front page."),
        default = 5
    ))

# Another example of allowing the user to select from several values
config_register(MultipleStringValue(
        MYAPP_GROUP,
        'MEASUREMENT_SYSTEM',
        description=_("Measurement System"),
        help_text=_("Default measurement system to use."),
        choices=[('metric',_('Metric')),
                    ('imperial',_('Imperial'))],
        default="imperial"
    ))

config_register(ModuleValue(
        MYAPP_GROUP,
        'MODULE',
        #description=_("Measurement System"),
Example #36
0
from .utils import ModelValue


# GIFT_INFO configs
GIFT_INFO = ConfigurationGroup(
    'GIFT_INFO',
    _('Gift configurations'),
    ordering=0
    )

# Codice univoco
config_register(
    StringValue(
        GIFT_INFO,
        'LABEL',
        description = _('Label for gift orders annotation'),
        help_text = "",
        default = "Is a gift."
    )
)

# Gift category
config_register(
    ModelValue(
        GIFT_INFO,
        'GIFT_CATEGORY',
        description=_(u'Gift Category'),
        help_text=_(u"Choose which category contains gift products"),
        queryset = Category.objects.all(),
        required=False
    )
Example #37
0
    MultipleStringValue, ConfigurationGroup, PositiveIntegerValue, \
    DecimalValue
# this is so that the translation utility will pick up the string
gettext = lambda s: s

SERVER_MODULES = config_get('SERVER', 'MODULES')
SERVER_MODULES.add_choice(('lcr', _('lcr')))

SERVER_GROUP = ConfigurationGroup('lcr', 
    _('Lcr Module Settings'), 
    requires=SERVER_MODULES,
    ordering = 100)

config_register_list(
   ModuleValue(SERVER_GROUP,
       'MODULE',
       description=_('Implementation module'),
       hidden=True,
       default = 'fsa.lcr') 
)

LCR_GROUP = ConfigurationGroup('LCR', _('Lcr Settings'), ordering=0)

config_register(PositiveIntegerValue(
    LCR_GROUP,
        'LCR_CSV',
        description = _('Default Lcr format'),
        help_text = _("CSV format file from load lcr data"),
        default = 3
    ))
Example #38
0
# -*- coding: utf-8 -*-
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, PercentValue, StringValue
from django.utils.translation import ugettext_lazy as _

# First, setup a grup to hold all our possible configs
MYAPP_GROUP = ConfigurationGroup(
    'MyApp',               # key: internal name of the group to be created
    u'Настройки сайта',  # name: verbose name which can be automatically translated
    ordering=0             # ordering: order of group in the list (default is 1)
    )


config_register(StringValue(
                            MYAPP_GROUP,
        'EMAIL', 
        description = u'Email администратора',
        help_text = u"Почта, куда будут приходить заявки.",
        default = '*****@*****.**'
    ))
Example #39
0
from livesettings import config_register, ConfigurationGroup, PositiveIntegerValue, MultipleStringValue
from django.utils.translation import ugettext_lazy as _
from livesettings.values import *

# First, setup a grup to hold all our possible configs
FATTURA_GROUP = ConfigurationGroup(
    "Fattura",  # key: internal name of the group to be created
    _("Configurazione documento"),  # name: verbose name which can be automatically translated
    ordering=0,  # ordering: order of group in the list (default is 1)
)

config_register(
    StringValue(
        FATTURA_GROUP,
        "RAGIONESOCIALE",
        description=_("ragione sociale azienda"),
        help_text=_("ragione sociale."),
        default="",
    )
)

config_register(
    BooleanValue(
        FATTURA_GROUP,
        "Iscrizione a gestione separata ",
        description=_("iscrizione a gestione separata"),
        help_text=_("iscrizione a gestione separata."),
        default=False,
    )
)
Example #40
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 = urlparse.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(
    BooleanValue(SHOP_GROUP,
    'SHOW_SITE',
    description = _('Show Site Field?'),
Example #41
0
for m in settings.INSTALLED_APPS:
    if(not m.startswith('django.') and m not in not_to_be_mapped):
        all_apps.append((m,m))

if('d2rq' in settings.INSTALLED_APPS):

    DR2Q_MAPPING = ConfigurationGroup(
        'd2rq',               # key: internal name of the group to be created
        _('Configuration du mapper RDF'),  # name: verbose name which can be automatically translated
        ordering=0             # ordering: order of group in the list (default is 1)
    )

    config_register(MultipleStringValue(
        DR2Q_MAPPING,
        'MAPPED_APPS',
        description=_("Selection des applications"),
        help_text=_("Selectionnez les applications avec des donnees a publier en RDF"),
        choices=all_apps,
        default=""
    ))

if('coop_cms' in settings.INSTALLED_APPS):

    COOPTREE_MAPPING = ConfigurationGroup('coop_cms', _('Navigation'))

    # Another example of allowing the user to select from several values
    config_register(MultipleStringValue(
        COOPTREE_MAPPING,
        'CONTENT_APPS',
        description=_("Selection des applications"),
        help_text=_("Selectionnez des applications contenant des objets navigables"),
        choices=all_apps,