Hi,

I have a problem - when creating an object, Django performs full table
SELECT from multiple tables and multiple times. Why?

I've set up MySQL to log all queries to the database. In Django I'm
using generic views. I have the following models/tables:
1. Firm
2. Person ( ForeignKey( Firm ))
3. PassageRoll( ForeignKey( Firm ))
4. Passage ( ForeignKey( Person ) and ForeignKey( PassageRoll ))
5. Some helper tables

I'm creating the new PassageRoll, the relevant URL is set up like this:
 (r'^firms/(?P<firm_id>\d+)/passroll/create/', '[...].passroll_create',
          {'model': PassageRoll, 'post_save_redirect': '../..',
'login_required':'True',}),

The GET-part of the view is empty - I'm calling generic Create.

After the form of the PassageRoll is displayed, the MySQL logfile
shows that the following queries were executed:
SELECT FIRM (*)
SELECT PERSON(*) - 4 times
[...]
SELECT `django_session`.`session_key`,.....
SELECT `auth_user`.`id`,...
SELECT FIRM (*)
SELECT PERSON(*) - 4 times
[...]
SELECT `auth_message`.`id`

Any ideas what might be wrong? How to find the place in blame?

Regards,

Andres

--~--~---------~--~----~------------~-------~--~----~
 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to