def get_modechoices(self): """ Returns a dictionary of modes for which there are currently vehicles in the database. Key is mode name and value is mode ID """ mode_vtypes = self.get_modes() mode_choice = OrderedDict() for mode, id_mode in MODES.iteritems(): if id_mode in mode_vtypes: mode_choice[mode] = id_mode return mode_choice