where should I put "raw_id_admin=True" ? in the foreing key declaration?
forma_parte_de = models.ForeignKey('Plantilla_bloque',related_name='dentro_de',blank=True,null=True) and what implications does it have? thank you Miguel Sent from Madrid, Spain On Tue, Mar 31, 2009 at 4:21 PM, Karen Tracey <kmtra...@gmail.com> wrote: > On Tue, Mar 31, 2009 at 9:52 AM, Miguel <migue...@gmail.com> wrote: > >> hi, >> >> I have found an optimizing problem. I have a model which i would like to >> edit, when I call my method I do something like this: >> >> >> def method_modify(request, method_id): >> >> try: >> manipulator = Pattern_method.ChangeManipulator(method_id) >> except Pattern_method.DoesNotExist: >> raise Http404 >> >> The problem I have found is that the ChangeManipulator takes me 15 seconds >> ... And this time is too much for a web applications. >> >> Is there any way to avoid this? >> >> Thank you in advance. >> > > Without any details of your Pattern_method model it's a little hard to > say. My first guess would be it has at least one ForeignKey to a huge table > and the time is taken up generating the drop-down list(s) for the Select > box(es) in the change manipulator. To fix that you could specify > raw_id_admin=True on the ForeignKey field(s). The name there implies it's > admin-specific but I think it was used by the basic ChangeManipulator, > though my knowledge of manipulators is close to zero so I could be wrong > about that. > > Karen > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---