t;>>> event pages, each event page can be tagged (using taggit), and I want to
>>>>> produce a list of distinct tags used in the events that belong to that
>>>>> event index on the index itself. I'm using the Django CMS Wagtail, but I
>>>>> guess this i
;> In my models I have an event index page type, which can have child
>>>> event pages, each event page can be tagged (using taggit), and I want to
>>>> produce a list of distinct tags used in the events that belong to that
>>>> event index on the index itse
> pages, each event page can be tagged (using taggit), and I want to produce
>>> a list of distinct tags used in the events that belong to that event index
>>> on the index itself. I'm using the Django CMS Wagtail, but I guess this is
>>> really a Django ORM query
jango CMS Wagtail, but I guess this is
>> really a Django ORM query question. I''ve got some code as part of my model
>> which is working but I don't think it's the most efficient way of doing
>> this. Still trying unlearn doing things with SQL and learn how the same
>&g
want to produce
> a list of distinct tags used in the events that belong to that event index
> on the index itself. I'm using the Django CMS Wagtail, but I guess this is
> really a Django ORM query question. I''ve got some code as part of my model
> which is working but I don't think
this is
really a Django ORM query question. I''ve got some code as part of my model
which is working but I don't think it's the most efficient way of doing
this. Still trying unlearn doing things with SQL and learn how the same
thing should be done in Django.
My code as part of the event index
Or, using range:
MyModel.objects.filter( Q(a__range=(1,5)) | Q(b__range=(20,70)) )
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects
MyModel.objects.filter( ( Q(a__gt=1) & Q(a__lt=5) ) | ( Q(b__gt=20) &
Q(b__lt=70) ) )
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
On 13 April 2010 01:09, zweb wrote:
> how do i do this kind of condition in django orm filter:
>
> ( 1 < a < 5) or ( 20 < b < 70)
>
> select * from table where (a between 1 and 5) or (b between 20 and 70)
>
> --
> You received this message because you are subscribed to
how do i do this kind of condition in django orm filter:
( 1 < a < 5) or ( 20 < b < 70)
select * from table where (a between 1 and 5) or (b between 20 and 70)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
10 matches
Mail list logo