﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
12173	hability to use OR in filterspecs	Fabián Ezequiel Gallina	nobody	"Currently when creating filterspecs we only can combine several rules using AND only. 

This patch adds the hability to use OR in the query.

== Why this could be useful? ==

Suppose we have a Taxes model which contains a due_date field and a payed_date field and we want to filter the non due taxes.

So non due taxes would be:

{{{
Q(due_date__gt=datetime.date.today()) | Q(payed_date__is_null=False)
}}}

== How we do that? ==

When creating a filterspec prepend the value of FILTERSPEC_OR_PREFIX (the value in the patch is {{{'__or__'}}}) to your fields like this:


{{{
[...]

        self.links = (
            (_('Non Due'), {'%s__gte' % self.field.name: str(today.date()),
                              '__or__payed_date__isnull' : 'False'}),
        )

[...]
}}}


PD: I also fixed a little typo in the line 208 (comment)"		closed	contrib.admin	dev		duplicate	filterspec, filter		Unreviewed	1	0	0	0	0	0
