On Mon, 2009-02-02 at 09:50 -0800, phoebebright wrote:
> After replicating you test and it still failing and various other
> experiments I downloaded the latest django trunk and it works fine!
> Always check the version first Phoebe!
>
> Sorry for the run around.
>
> For the record here are the
After replicating you test and it still failing and various other
experiments I downloaded the latest django trunk and it works fine!
Always check the version first Phoebe!
Sorry for the run around.
For the record here are the two queries - correct one first, the
difference is in the SELECT part
On Fri, 2009-01-30 at 07:46 -0800, phoebebright wrote:
> Using your suggestion returns no values:
Then there is something else going on in your code that is important and
you haven't mentioned yet.
If I use exactly the models you give:
> class Category(models.Model):
> name = models.CharFi
Using your suggestion returns no values:
In [9]: Subcategory.objects.values('name').exclude(business=None)
Out[9]: []
And there are subcategories:
In [10]: Subcategory.objects.values('name')
Out[10]: [{'name': u'Agricultural'}, {'name': u'Auctioneers & Estate
Agents'}, {'name': u'Construction &
On Thu, 2009-01-29 at 06:44 -0800, phoebebright wrote:
> I want a distinct list of all the 'cat__names' that exist in
> Subcategory and have at least one entry in Business (Business is a
> subclass of model Directory which might be the problem)
>
> dir_query = Business.objects.all().select_relate
That's an interesting post but I havn't managed to get it to solve my
problem because I'm looking for a list of all categories and that
method using FOO_set only seems to work on a single object (get).
Also tried the raw sql method but I get an SQL error
(1064, "You have an error in your SQL syn
On Jan 29, 8:44 am, phoebebright wrote:
> I want a distinct list of all the 'cat__names' that exist in
> Subcategory and have at least one entry in Business (Business is a
> subclass of model Directory which might be the problem)
>
> dir_query = Business.objects.all().select_related().distinct(
I want a distinct list of all the 'cat__names' that exist in
Subcategory and have at least one entry in Business (Business is a
subclass of model Directory which might be the problem)
dir_query = Business.objects.all().select_related().distinct()
...
subcats = dir_query.values('cat__name','cat').
8 matches
Mail list logo