models.py:
class Town(models.Model):
...
class People(models.Model):
town = models.ForeignKey(Town, related_name="town")
But I have many towns in db, 4000-6000.
And when I use PeopeAdmin in admin.py, Django downloads in select-form all towns, and do this very-very slow.
How to fix that? Does I need to use memcached or something else?
You need raw_id_fields
, which uses a pop-up interface rather than a select box.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With