| 97 | def add_to_inlines(self, target_model, inline_admin_classes): |
| 98 | if target_model not in self._registry: |
| 99 | return False |
| 100 | if not hasattr(inline_admin_classes, '__iter__'): |
| 101 | inline_admin_classes = [inline_admin_classes] |
| 102 | for cls in inline_admin_classes: |
| 103 | inline_instance = cls(self._registry[target_model].model, self._registry[target_model].admin_site) |
| 104 | if inline_instance not in self._registry[target_model].inline_instances: |
| 105 | self._registry[target_model].inline_instances.append(inline_instance) |
| 106 | return True |
| 107 | |