Very slow M2M loading on Django

Asked

Viewed 20 times

0

In some tables I use Many to Many, and as the bank has been growing its loading time is increasing (which is obvious), I got an alternative to the load, which is raw_id_fields, however it does not supply the demand as desired, if the raw id displayed the "name" instead of id would be perfect. Is there any alternative to improve M2m loading ?

apensos = models.ManyToManyField(Processo, blank=True, default=None, related_name="Apensos")

This is an example of the use, in all others the use and basically the same, pulling the data from the table processes.

And in admin.py use:

raw_id_fields = ("apensos",)
  • Can you show me how you’re doing? A simplistic version of your models (only the related models, the Imports, and you can take the unnecessary fields) - besides what you are using to "load the database" - is it a script? Use a CSV file with the data??

  • edited the post by adding friend. I forgot to mention that I use the Django admin

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.