On 9/18/06, Tom Smith <[EMAIL PROTECTED]> wrote:
> Not really.. having built and manipulated (with exludes, filters, order
> etc.) I'd quite like to peep at the SQL before it gets executed to see if it
> makes sense
I think it probably is possible by screwing around with internal
variables of
On 18 Sep 2006, at 16:26, James Bennett wrote:p.exclude() returns a new QuerySet with the filtering, so you need to grab the return value, like this: if len(notsitelist)>=1: print "excluding sites: ", notsitelist p = p.exclude(fk_site__in=notsitelist) That was it... silly me, just missed i
On 18 Sep 2006, at 16:27, Michael Radziej wrote: Is there way to do p.get_query(.)p.show_sql() I really don't get what this is supposed to mean, it just looks like seriously broken syntax. Not really.. having built and manipulated (with exludes, filters, order etc.) I'd quite like to peep at the
On 9/18/06, Tom Smith <[EMAIL PROTECTED]> wrote:
> I have...
>
> p = Product.objects
> if len(notsitelist)>=1:
> print "exluding sites: ", notsitelist
> p.exclude(fk_site__in=notsitelist)
p.exclude() returns a new QuerySet with the filtering, so yo
Tom Smith wrote:
> Thanks... I'm not sure but I don't think this is working
>
> I have...
>
> p = Product.objects
> if len(notsitelist)>=1:
> print "exluding sites: ", notsitelist
> p.exclude(fk_site__in=notsitelist)
>
> if len(cats)>=1:
>
> Query sets are not executed on the database until you iterate, or
> otherwise try to extract data from them.
>
> o = Recipe.objects
> o2 = o.filter(xx)
> o3 = o2.filter(yy)
> o4 = o3.filter(zz)
>
> print o4
>
> will result in just 1 query getting issued to the database - the final
> query with t
On 9/16/06, Tom Smith <[EMAIL PROTECTED]> wrote:
>
> Recipe.objects.exclude(category__in=words)
>
> ...which is great, but now having set words to and empty list [] I
> get the error...
This is an issue that has been previously reported:
http://code.djangoproject.com/ticket/2473
> So... would i
On 16 Sep 2006, at 12:42, Malcolm Tredinnick wrote:
>
> On Sat, 2006-09-16 at 12:25 +0100, Tom Smith wrote:
>> How would I build an "AND" query...
>>
>> for example...
>>
>> words = ['chicken', 'beef', 'lamb']
>> Recipe.objects.exclude(title__contains=words)
>>
>> I don't want to do 3 queries...
On Sat, 2006-09-16 at 12:25 +0100, Tom Smith wrote:
> How would I build an "AND" query...
>
> for example...
>
> words = ['chicken', 'beef', 'lamb']
> Recipe.objects.exclude(title__contains=words)
>
> I don't want to do 3 queries...
Please start a new thread for new topics, rather than droppin
9 matches
Mail list logo