daniyalzade / django_reverse_admin

Django Reverse Admin
BSD 3-Clause "New" or "Revised" License
199 stars 54 forks source link

Allow Select2 dropdown for ForeignKeys in the reversed Model #281

Open ghost opened 3 years ago

ghost commented 3 years ago

Let's say you have the following model structure, modified from the README example:

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')

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.

gabrielhruza commented 2 years ago

i'm having the same issue :/