filters vs qfilters (trying to implement django-customreports)

124 views
Skip to first unread message

Bob Haugen

unread,
Mar 17, 2012, 6:28:44 AM3/17/12
to django...@googlegroups.com
I'm trying to implement django-customreports, and created a test project that includes:
* django-displayset and
* django-customreports.

I'm running Django-1.3.1

django-displayset appears to prefer django-qfilters to django-filter-actually-maintained (if I understand correctly).

The tests for django-filters and django-customreports both fail:

django-filters:
AssertionError: Failed doctest test for django_filters.tests.__test__.filter_tests
Failed example:
    f.qs
Expected:
    [<Comment: alex said super awesome!>, <Comment: aaron said psycadelic!>]
Got:
    []

django-customreports:
FAIL: test_results (django_customreport.tests.tests.BasicTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/bob/subsumetest/django_customreport/tests/tests.py", line 45, in test_results
    self.assertEquals(len(qs),5)
AssertionError: 0 != 5

django_customreport/tests/tests.py says:
               "The first person has two locations assigned to them. One is 90210 and its open_saturday,
one is 32801 and its not open saturday. The below query *should* return 0 results, however,
a limitation of django_filters queries them separately and therefore we get results when
we shouldn't."

Is this the reason for django-qfilters, and is that what I should be using for django-customreports?  

Any other tips for implementing django-customreports?  Has anybody put them all together in an open-source project that I could look at?
(Sorry if this is the wrong place for those questions, but subsumed has replied in this group and I figured it might be better than sending a private email...)

Thanks,
Bob Haugen

Bob Haugen

unread,
Mar 17, 2012, 9:20:35 AM3/17/12
to django...@googlegroups.com
Answering one of my own questions:  substituting qfilters for django_filters made no difference, the same test still failed.

And just for the record, I found that django_customreports is also dependent on django_relation_selector.

I'll ask my followup questions about django_customreports elsewhere...

Steve

unread,
Mar 17, 2012, 10:55:23 AM3/17/12
to django...@googlegroups.com
Hey there,

Some co-workers and I authored custom-report and displaysets a while back. qfilters solves joining problem when using chained filter statements. That's all it does.

Admittedly we could do a way better job on the documentation side. Django relations selector was just an internal that messed with querysets to join things on and we abstracted it out.

There's some examples in the README pages of those projects.

qfilters is 
Reply all
Reply to author
Forward
0 new messages