Exemplo n.º 1
0
    def _get_parameters(self):
        ''' Get the parameters for the datamodel '''

        # if the release isn't in the allowed releases then do nothing
        # if self.release not in config._allowed_releases:
        #     self._groups = ParameterGroupList([])
        #     return

        # check cache for parameters
        if self.release in PARAM_CACHE:
            self._keys = PARAM_CACHE[self.release]
            return

        # get the parameters
        if self._mode == 'local':
            self._marvinform = MarvinForm(release=self.release)
            self._cleanup_keys()
        elif self._mode == 'remote':
            self._get_from_remote()
        elif self._mode == 'auto':
            if config.db:
                self._mode = 'local'
            else:
                self._mode = 'remote'
            self._get_parameters()
Exemplo n.º 2
0
 def __init__(self):
     ''' Initialize the route '''
     super(Search, self).__init__('marvin-search')
     self.search = self.base.copy()
     self.search['filter'] = None
     self.search['results'] = None
     self.search['errmsg'] = None
     self.search['returnparams'] = None
     self.mf = MarvinForm()
Exemplo n.º 3
0
    def __init__(self, release, groups=[], aliases=[], exclude=[], **kwargs):

        self.release = release
        self._groups = groups
        self._groups.set_parent(self)
        self.aliases = aliases
        self._exclude = exclude
        self.dap_datamodel = kwargs.get('dapdm', None)
        self._marvinform = MarvinForm(release=release)
        self._cleanup_keys()
        self._check_datamodels()
Exemplo n.º 4
0
 def _reset_marvinform(self):
     self._marvinform = MarvinForm(release=self.release)
Exemplo n.º 5
0
 def use_all_spaxels(self):
     ''' Sets the datamodel to use all the spaxels '''
     self._marvinform = MarvinForm(release=self.release, allspaxels=True)
     self._cleanup_keys()