I have a question with "ModelForm"

16 views
Skip to first unread message

Jonathan Espinal

unread,
Oct 27, 2013, 1:34:44 AM10/27/13
to django...@googlegroups.com
I have a question with "ModelForm", I have a accounts model with a foreignkey on users model, when I try to save a record using "ModelForm", the SQL "debug_toolbar" show my 2 aditionals query:

"SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "auth_user"."id" = 1"

and

"SELECT (1) AS "a" FROM "auth_user" WHERE "auth_user"."id" = 1 LIMIT 1"

Could I avoid that, or what am i doing wrong ?

Thanks...
Reply all
Reply to author
Forward
0 new messages