def __init__(self):
        self.options = {
            Status.INACTIVE: 'Inactive',
            Status.ACTIVE: 'Active',
        }

        OptionsModule.__init__(self, options=self.options, disabled=True)
Example #2
0
    def __init__(self):
        self.options = {
            'inactive': 'Inactive',
            'active': 'Active',
            'deleted': 'Deleted',
        }

        OptionsModule.__init__(self, options=self.options, disabled=True)
    def __init__(self):
        self.options = {
            'inactive': 'Inactive',
            'active': 'Active',
            'deleted': 'Deleted',
        }

        OptionsModule.__init__(self, options=self.options, disabled=True)
Example #4
0
    def __init__(self):
        self.options = {
            'None': '--------',
            'FRANCE': 'France',
            'UNITED STATES OF AMERICA': 'USA',
        }

        OptionsModule.__init__(self,
                               options=self.options,
                               label='Select a Country')
Example #5
0
    def __init__(self):
        self.options = {
            'None': '--------',
            'FRANCE': 'France',
            'UNITED STATES OF AMERICA': 'USA',
        }

        OptionsModule.__init__(
            self,
            options=self.options,
            label='Select a Country',
            scripts=[os.path.join(SCRIPTS_PATH, 'countries.js')])
    def __init__(self):
        self.options = {
            "Ac": "Actinium",
            "Al": "Aluminum",
            "Ag": "Silver",
            "Am": "Americium",
            "Ar": "Argon",
            "As": "Arsenic",
            "At": "Astatine",
            "Au": "Gold",
        }

        OptionsModule.__init__(self, options=self.options, label="Select an element")
Example #7
0
    def __init__(self):
        self.options = {
            'Ac': 'Actinium',
            'Al': 'Aluminum',
            'Ag': 'Silver',
            'Am': 'Americium',
            'Ar': 'Argon',
            'As': 'Arsenic',
            'At': 'Astatine',
            'Au': 'Gold'
        }

        OptionsModule.__init__(self,
                               options=self.options,
                               label='Select an element')
    def _get_module(self, request):
        # look for existing values
        try:
            # keyrefId = request.GET['keyref'] if 'keyref' in request.GET else None
            module_id = request.GET['module_id']
            module = SchemaElement.objects().get(pk=module_id)
            keyrefId = module.options['params']['keyref']
            # register the module id in the structure
            if str(module_id) not in request.session['keyrefs'][keyrefId]['module_ids']:
                request.session['keyrefs'][keyrefId]['module_ids'].append(str(module_id))

            # get the list of values for this key
            keyId = request.session['keyrefs'][keyrefId]['refer']
            values = []
            modules_ids = request.session['keys'][keyId]['module_ids']
            for key_module_id in modules_ids:
                key_module = SchemaElement.objects().get(pk=key_module_id)
                if key_module.options['data'] is not None:
                    values.append(key_module.options['data'])

            # add empty value
            self.options.update({'': ''})
            for value in values:
                self.options.update({str(value): str(value)})

            self.selected = ''
            if 'data' in request.GET:
                self.selected = request.GET['data']
            elif 'data' in module.options and module.options['data'] is not None:
                self.selected = str(module.options['data'])
        except Exception:
            self.options = {}
        return OptionsModule.get_module(self, request)
 def _get_module(self, request):
     self.selected = "active"
     if 'data' in request.GET:
         if request.GET['data'] in self.options.keys():
             self.disabled = False
             self.selected = request.GET['data']
     return OptionsModule.get_module(self, request)
 def _get_module(self, request):
     self.selected = Status.ACTIVE
     if 'data' in request.GET:
         if request.GET['data'] in self.options.keys():
             self.disabled = False
             self.selected = request.GET['data']
     return OptionsModule.get_module(self, request)
Example #11
0
    def _get_module(self, request):
        # look for existing values
        try:
            # keyrefId = request.GET['keyref'] if 'keyref' in request.GET else None
            module_id = request.GET['module_id']
            module = SchemaElement.objects().get(pk=module_id)
            keyrefId = module.options['params']['keyref']
            # register the module id in the structure
            if str(module_id
                   ) not in request.session['keyrefs'][keyrefId]['module_ids']:
                request.session['keyrefs'][keyrefId]['module_ids'].append(
                    str(module_id))

            # get the list of values for this key
            keyId = request.session['keyrefs'][keyrefId]['refer']
            values = []
            modules_ids = request.session['keys'][keyId]['module_ids']
            for key_module_id in modules_ids:
                key_module = SchemaElement.objects().get(pk=key_module_id)
                if key_module.options['data'] is not None:
                    values.append(key_module.options['data'])

            # add empty value
            self.options.update({'': ''})
            for value in values:
                self.options.update({str(value): str(value)})

            self.selected = ''
            if 'data' in request.GET:
                self.selected = request.GET['data']
            elif 'data' in module.options and module.options[
                    'data'] is not None:
                self.selected = str(module.options['data'])
        except Exception:
            self.options = {}
        return OptionsModule.get_module(self, request)
Example #12
0
 def __init__(self):
     OptionsModule.__init__(
         self,
         options={},
         scripts=[os.path.join(SCRIPTS_PATH, 'autokey.js')])
 def __init__(self):
     OptionsModule.__init__(self, options={}, scripts=[os.path.join(SCRIPTS_PATH, 'autokey.js')])
Example #14
0
 def _get_module(self, request):
     return OptionsModule.get_module(self, request)
    def __init__(self):
        self.options = {"None": "--------", "FRANCE": "France", "UNITED STATES OF AMERICA": "USA"}

        OptionsModule.__init__(
            self, options=self.options, label="Select a Country", scripts=[os.path.join(SCRIPTS_PATH, "countries.js")]
        )
 def _get_module(self, request):
     return OptionsModule.get_module(self, request)
Example #17
0
    def __init__(self):
        self.options = {"None": "--------", "FRANCE": "France", "UNITED STATES OF AMERICA": "USA"}

        OptionsModule.__init__(self, options=self.options, label="Select a Country")