=== modified file 'django/contrib/admin/options.py'
|
|
|
665 | 665 | self.parent_model = parent_model |
666 | 666 | self.opts = self.model._meta |
667 | 667 | super(InlineModelAdmin, self).__init__() |
| 668 | |
| 669 | def formfield_for_dbfield(self, db_field, **kwargs): |
| 670 | if isinstance(db_field, models.ForeignKey): |
| 671 | kwargs['cache_choices'] = True |
| 672 | return super(InlineModelAdmin, self).formfield_for_dbfield(db_field, **kwargs) |
668 | 673 | |
669 | 674 | def formset_add(self, request): |
670 | 675 | """Returns an InlineFormSet class for use in admin add views.""" |