Hi,
sometimes it happens, that db queries get executed at import time (during
importing the file by the interpreter).
That's waste of time a resources.
Is there a way to test how many queries get executing during import? I want
some automated way to detect these db queries.
Example:
def mychoices():
for obj in MyModel.objects.all(): # this hits the db during import. That's
not good.
....
class MyForm(forms.Form):
foo=forms.ChoiceField(choices=mychoices())
--
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.