I see where this has already been addressed in ticket #2457 http://code.djangoproject.com/ticket/2457
Apparently it's a bug in the version of sqlite that's bundled with the Windows installer (3.3.4). The command line version of sqlite that I'm running is much more recent, which explains the different results. I originally thought it was just a misunderstanding on my part of the docs or else I would have researched it a little more before posting. Thanks for the help. On 5/16/07, Ben Jones <[EMAIL PROTECTED]> wrote: > > 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 > -- -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 -~----------~----~----~----~------~----~------~--~---