def get_replay_storage_setting(self): storage_all = get_replay_storage_setting() if self.replay_storage in storage_all: storage = storage_all.get(self.replay_storage) else: storage = storage_all.get('default') return {"TERMINAL_REPLAY_STORAGE": storage}
def get_context_data(self, **kwargs): command_storage = utils.get_command_storage_setting() replay_storage = utils.get_replay_storage_setting() context = { 'app': _('Settings'), 'action': _('Terminal setting'), 'form': self.form_class(), 'replay_storage': replay_storage, 'command_storage': command_storage } kwargs.update(context) return super().get_context_data(**kwargs)
def get_all_replay_storage(): from common import utils replay_storage = utils.get_replay_storage_setting() for k, v in replay_storage.items(): yield (k, k)