On Apr 25, 3:35 pm, Jonas Ghyllebert <jghylleb...@nuvia.io> wrote: > I'm new to Django and I would like to apologize if it's been asked before. > > I have two models *Region *and *Zip*. In the admin system, Zip is an inline > model in Region > > Whenever i want to add a Region it shows directly 25 listboxes with zips. > This however takes a long time to load the page and results in an internal > error. > There are 2,774 records in the zip table. > I suspect the cause of this error is that for each list, Django connects to > the database to fetch those records. > Is there a way to solve this?
Your question is a little hard to answer - it is always a good idea to include the full error message, and preferably the model definitions etc in your post. You leave all who try to help guessing what the problem might be... Without knowing more about the situation I suggest you check the queries the page loading generates (using logging, django-debug- toolbar or your database's query logging utilities). Then check if there is a possibility to use select_related or prefetch_related to ease the situation. The internal error seems a little strange. Can you share more details about that? - Anssi -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.