@property<EOL><INDENT>def comparable(self):<DEDENT>
document_dict = self.compare_safe(self._document)<EOL>self._remove_keys(document_dict, self._uncompared_fields)<EOL>clean_document_dict = {}<EOL>for k, v in document_dict.items():<EOL><INDENT>if not v and not isinstance(v, (int, float)):<EOL><INDENT>continue<EOL><DEDENT>clean_document_dict[k] = v<EOL><DEDENT>for ref_field, ref_cls in self._compared_refs.items():<EOL><INDENT>ref = getattr(self, ref_field)<EOL>if not ref:<EOL><INDENT>continue<EOL><DEDENT>if isinstance(ref, list):<EOL><INDENT>if isinstance(ref[<NUM_LIT:0>], Frame):<EOL><INDENT>continue<EOL><DEDENT>setattr(<EOL>clean_document_dict,<EOL>ref_field,<EOL>ref_cls.many(In(Q._id, ref))<EOL>)<EOL><DEDENT>else:<EOL><INDENT>if isinstance(ref, Frame):<EOL><INDENT>continue<EOL><DEDENT>setattr(<EOL>clean_document_dict,<EOL>ref_field,<EOL>ref_cls.byId(ref)<EOL>)<EOL><DEDENT><DEDENT>return clean_document_dict<EOL>
Return a dictionary that can be compared