def _collect_editable_booleans(self):
if hasattr(self, '<STR_LIT>'):<EOL><INDENT>return<EOL><DEDENT>self._ajax_editable_booleans = {}<EOL>for field in self.list_display:<EOL><INDENT>item = getattr(self.__class__, field, None)<EOL>if not item:<EOL><INDENT>continue<EOL><DEDENT>attr = getattr(item, '<STR_LIT>', None)<EOL>if attr:<EOL><INDENT>def _fn(self, instance):<EOL><INDENT>return [ajax_editable_boolean_cell(instance, _fn.attr)]<EOL><DEDENT>_fn.attr = attr<EOL>result_func = getattr(item, '<STR_LIT>', _fn)<EOL>self._ajax_editable_booleans[attr] = result_func<EOL><DEDENT><DEDENT>
Collect all fields marked as editable booleans. We do not
want the user to be able to edit arbitrary fields by crafting
an AJAX request by hand.