Example #1
0
from django.apps import AppConfig
from django.conf import settings
from mighty import over_config
import os.path, csv


class Config:
    directory = os.path.dirname(os.path.realpath(__file__))
    csvfile = '%s/countries.csv' % directory
    encoding = 'utf8'
    delimiter = ','
    quotchar = '"'
    quoting = csv.QUOTE_ALL
    default = 'fr'
    availables = ['fr']


if hasattr(settings, 'NATIONALITY'): over_config(Config, settings.NATIONALITY)


class NationalityConfig(AppConfig, Config):
    name = 'mighty.applications.nationality'
Example #2
0
        },
        {
            'name': 'salariƩ',
        },
    ]
    group_api = {
        "uid": "group.uid",
        "image_url": "group.image_url",
    }

    class ForeignKey:
        group = setting('TENANT_GROUP', 'auth.Group')
        role = setting('TENANT_ROLE', 'mighty.Role')
        #alternate = setting('TENANT_ALTERNATE', 'mighty.TenantAlternate')
        tenant = setting('TENANT_MODEL', 'mighty.Tenant')
        missive = setting('TENANT_MISSIVE', 'mighty.Missive')
        invitation = setting('TENANT_INVITATION', 'mighty.TenantInvitation')
        nationalities = setting('TENANT_NATIONALITY', 'mighty.Nationality')
        user = settings.AUTH_USER_MODEL
        optional = False


if hasattr(settings, 'TENANT'): over_config(Config, settings.TENANT)


class TenantConfig(AppConfig, Config):
    name = 'mighty.applications.tenant'

    def ready(self):
        from . import signals
Example #3
0
from django.apps import AppConfig
from django.conf import settings
from mighty import over_config


class Config:
    groups_onsave = []
    mail_protect_spam = 5
    sms_protect_spam = 5
    minutes_allowed = 5
    code_size = 6
    email_code = 'twofactor/email_code.html'

    class method:
        email = True
        sms = True
        basic = False


if hasattr(settings, 'TWOFACTOR'): over_config(Config, settings.TWOFACTOR)


class TwofactorConfig(AppConfig, Config):
    name = 'mighty.applications.twofactor'
Example #4
0
        }
        var css_selector_classes = ['page', 'frompage', 'topage', 'webpage', 'section', 'subsection', 'date', 'isodate', 'time', 'title', 'doctitle', 'sitepage', 'sitepages'];
        for (var css_class in css_selector_classes) {
            if (css_selector_classes.hasOwnProperty(css_class)) {
                var element = document.getElementsByClassName(css_selector_classes[css_class]);
                for (var j = 0; j < element.length; ++j) {
                    element[j].textContent = vars[css_selector_classes[css_class]];
                }
            }
        }
    }
    </script>
  </head>
  <body onload="subst()">%s</body>
</html>"""
    pdf_content = """<!DOCTYPE html>
<html>
<head>
    <meta charset=UTF-8" />
</head>
<body><br><br>%s</body>
</html>"""


if hasattr(settings, 'DOCUMENT'):
    over_config(Config, getattr(settings, 'MESSENGER'))


class DocumentConfig(AppConfig, Config):
    name = 'mighty.applications.document'
Example #5
0
            "effective",
            "current",
            "securities",
            "dividend",
            "net_profit",
            "turnover",
        ]

    class Test:
        fr_siren = '820807246'

    class Model:
        Company = 'Company'
        CompanyFR = 'CompanyFR'
        CompanyAddressFR = 'CompanyAddressFR'
        Balo = 'Balo'

    class Announce:
        Balo = False
        Balo_dateformat = '%Y%m%d'


if hasattr(settings, 'COMPANY'): over_config(Config, settings.COMPANY)


class CompanyConfig(AppConfig, Config):
    name = 'company'

    def ready(self):
        from . import signals
Example #6
0
        format_user = "******"
        format_code = "{}_code"
        format_color = "{}_color"
        file_open_method = "a"
        name_file = "{}/{}_{}_{}_{}.log"

    class Color:
        default = "\033[0m"
        emerg = "\033[1;93;5;101m"
        alert = "\033[1;30;5;105m"
        crit = "\033[1;97;5;101m"
        error = "\033[0;31m"
        warning = "\033[0;91m"
        notice = "\033[0;97m"
        info = "\033[0;94m"
        debug = "\033[0;30;100m"

    class Code:
        emerg = 60
        alert = 55
        critical = 50
        error = 40
        warning = 30
        notice = 25
        info = 20
        debug = 10

if hasattr(settings, 'LOGGER'): over_config(Config, settings.LOGGER)
class LoggerConfig(AppConfig, Config):
    name = 'mighty.applications.logger'
Example #7
0
from django.apps import AppConfig
from django.conf import settings
from mighty.functions import setting
from mighty import over_config


class Config:
    pass


if hasattr(settings, 'SHOP'): over_config(Config, settings.SHOP)


class ShopConfig(AppConfig, Config):
    name = 'mighty.applications.shop'
    group = setting('PAYMENT_GROUP', 'auth.Group')
    method = setting('PAYMENT_METHOD', 'mighty.PaymentMethod')
Example #8
0
    class ForeignKey:
        missive = 'mighty.Missive'
        invitation = 'mighty.Invitation'
        nationalities = 'mighty.Nationality'
        email = 'mighty.UserEmail'
        phone = 'mighty.UserPhone'
        address = 'mighty.UserAddress'
        user = settings.AUTH_USER_MODEL
        optional = False
        optional2 = False
        optional3 = False
        optional4 = False
        optional5 = False

    class Field:
        username = '******'
        required = ('cgu', )
        optional = ('phone', )
        style = ['dark', 'light']


if hasattr(settings, 'USER'): over_config(Config, settings.USER)


class UserConfig(AppConfig, Config):
    name = 'mighty.applications.user'

    def ready(self):
        from . import signals
Example #9
0
from django.apps import AppConfig
from django.conf import settings
from mighty import over_config
from mighty.functions import setting

class Config:
    backend = 'mighty.applications.address.backends.geopy.SearchBackend'

    class Default:
        country = 'France'
        country_code = 'FR'

    class Key:
        google = setting('GOOGLE_API_ADDRESS')
        mapbox = setting('MAPBOX_ACCESS_TOKEN')

if hasattr(settings, 'ADDRESS'): over_config(Config, settings.ADDRESS)
class AddressConfig(AppConfig, Config):
    name = 'mighty.applications.address'