Open ghost opened 3 years ago
i'm having the same issue :/
Perhaps a little bit too late, but you can specify admin class in inline_reverse
, for example using example you supplied:
models.py
class Street(models.Model):
street_name = models.CharField(max_length=255)
class Address(models.Model):
street = models.ForeignKey(Street)
class Person(models.Model):
name = models.CharField(max_length=255)
home_addr = models.OneToOneField(Address, related_name='home_addr')
admin.py:
.....
class AddressInlineAdmin(admin.StackedInline):
model = Address
autocomplete_fields = ['street']
class PersonAdmin(ReverseModelAdmin):
inline_type = 'stacked'
inline_reverse = [{'field_name': 'home_addr', 'admin_class': AddressInlineAdmin}]
......
Let's say you have the following model structure, modified from the README example:
If the amount of "Street" objects you have is too large, a Select2 dropdown is preferred, and currently there's no way of having them. Adding the fields to
autocomplete_fields
does nothing.