> Might be worthwhile having a look at the SQL Django is generating. From
> the shell prompt import db.connection and have a look at
> db.connection.queries after running the query.
>
> I wouldn't be too surprised to discover this is a bug caused by using a
> left outer join here, in which case it's already in the pipeline to be
> fixed (there are a couple of cases where that's happening). However, it
> would be good to confirm that.

The query is below. Django is still showing me all three content
records, however when I run this query on the sqlite command line I
only get the single record I am expecting. To get it to run on the
cli, however, I did have to quote the "list-1" in the WHERE clause --
I'm guessing that Django did that prior to executing it.


SELECT "train_content"."id","train_content"."slug",
"train_content"."title","train_content"."author",
"train_content"."body","train_content"."pub_date",
"train_content"."add_date","train_content"."mod_date",
"train_content"."template","train_content"."status"

FROM "train_content"

LEFT OUTER JOIN "train_content_categories"
AS "m2m_train_content__categories"
ON "train_content"."id" = "m2m_train_content__categories"."content_id"

INNER JOIN "train_category"
AS "train_content__categories"
ON "m2m_train_content__categories"."category_id" =
"train_content__categories"."id"

WHERE ("train_content__categories"."slug" = list-1)

--
    -Ben

--~--~---------~--~----~------------~-------~--~----~
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