def populateComboEntry(self, combo, type_, func, sort = None): model = gtk.ListStore(gobject.TYPE_STRING, gobject.TYPE_INT) combo.set_model(model) combo.set_text_column(0) result = self.backend.search(type_) if sort: result.sort(sort) for r in result: model.append(("%s"%func(r), hasattr(r, "id") and r.id or 0))