On Wed, Jul 15, 2009 at 9:31 AM, joep <joe.archet...@gmail.com> wrote:

>
> I'm new to both python and django, so please excuse my ignorance if
> this is obvious. I have a tagged model which I would like to form a
> tag cloud. I am using the following
>
>    t = Tag.objects.cloud_for_model(Post,
>            filters=dict(
>                blog__slug=blog_slug,
>                publish__lte=datetime.datetime.now(),
>                expiry__gt=datetime.datetime.now(),
>            )
>        )
>
> This is fine except most of the expiry fields are None (i.e., never
> expire), but I can't figure out how to add these back into the
> queryset filters. In other words, I want
>
>       expiry__gt=datetime.datetime.now() OR expiry=None
>
> Again, this may be obvious, but I haven't figured it out.
>
>
>
> >
>
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objectsexplains
how to do queries with OR clauses.
Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Voltaire
"The people's good is the highest law." -- Cicero
"Code can always be simpler than you think, but never as simple as you want"
-- Me

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to