Im trying to setup situation where users of application can do statistical analysis of data.
There are 3 tables, users, exams, polls
I should have gui to build custom queries, like these:
users born between 1930 and 1940, that have 3 exams taken; show name, surname, group by age of person
开发者_开发问答count of users born 1945 that have not taken poll grouped by reason;show count,reason
Language of choice is python, django. If anyone has experience or can recommend some python package that would make my job easier I'd be greatful.
I have developed django-cube for this very purpose.
It allows you to organize your django data as multi-dimensional data, declare an aggregation function (to calculate your statistics), and then you have several helpers to display a table, and ready-to-use Django templates for tables.
I've had some pretty good success recently using Alex Gaynor's django-filter
app, located here.
It brings a lot of the Django admin's drill-down filtering controls to your site's front-end objects, and after a bit of configuration you should be able to use it to provide a nice set of filters for your User, Exam, and Poll models that anyone can use.
精彩评论