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 11981,Add custom Q-object (add_to_query) support to QuerySet.filter() and QuerySet.exclude(),Johannes Dollinger,nobody,"It would be nice if custom Q-objects could be transparently used in `filter()` and `exclude()` calls (if they provide an `__invert__()` method). The following code illustrates the desired behaviour: {{{ #!python class QuerySet(models.query.QuerySet): def filter(self, *args, **kwargs): if not kwargs and len(args) == 1 and hasattr(args[0], 'add_to_query'): return self.complex_filter(args[0]) return super(QuerySet, self).filter(*args, **kwargs) def exclude(self, *args, **kwargs): if not kwargs and len(args) == 1: return self.complex_filter(~args[0]) return super(QuerySet, self).exclude(*args, **kwargs) }}} ",New feature,closed,"Database layer (models, ORM)",dev,Normal,wontfix,"complex_filter, add_to_query",,Someday/Maybe,1,0,0,0,0,0