4 Summary: Django admin tool for custom reports
5 Home-page: http://versae.github.com/qbe/
6 Author: Javier de la Rosa
7 Author-email: versae@gmail.com
9 Description: Django Query by Example (QBE)
10 =============================
12 :synopsis: Admin tool in order to get custom reports.
14 The objective of django-qbe is provide a assited and interactive way of making
15 complex queries with no technical knowledge (or minimal) to get custom reports
16 from the objects of Django models.
18 Based on QBE_ proposal from IBM®, django-qbe is intended to remove the
19 limitations of Django QuerySets objects and to use the whole expresive power of
26 Using the Python Package Index (PyPI_) and easy_install script::
28 $ easy_install django_qbe
32 $ pip install django_qbe
34 But you also can download the *django_qbe* directory using git::
36 $ git clone git://github.com/versae/qbe.git
37 $ cp -r qbe/django_qbe /path/to/your/project
39 Adding to the project settings::
42 # [...] django builtins applications
44 # [...] Any other application
47 And adding the urlconf in your project urls.py::
50 url(r'^qbe/', include('django_qbe.urls')),
52 If you are using Django 1.2 or any previous version you must link or copy the
53 *django_qbe/static/django_qbe* directory in your project media directory::
55 $ ln -s django_qbe/static/django_qbe /path/to/your/project/media/
57 And enable the context processor *django.core.context_processors.media*::
59 TEMPLATE_CONTEXT_PROCESSORS = (
60 # [...] django context processors
61 'django.core.context_processors.media',
62 # [...] Any other context processors
65 But if you're using Django 1.3 or later the static files will be found and served
66 automatically, you don't need to do anything except adding the context processor
67 *django.core.context_processors.static*::
69 TEMPLATE_CONTEXT_PROCESSORS = (
70 # [...] django context processors
71 'django.core.context_processors.static',
72 # [...] Any other context processors
75 See the `Django documentation on static files`__ for details.
79 That's all. Then you can access to http://host:port/qbe
80 However, you can add a link from your admin page changing the admin index
81 template fo your AdminSite::
83 class AdminSite(admin.AdminSite):
84 index_template = "qbe_index.html"
86 Or adding in your custom admin index template the next javascript::
88 <script type="text/javascript" src="{% url qbe_js %}"></script>
94 The next lines show de available settings and its default values.
96 Enable autocompletion tool (work in progress, not enabled yet)::
98 QBE_AUTOCOMPLETE = True
100 Enable an Exhibit faceted navigation for results (not yet implemented)::
104 Admin module name to add admin urls in results::
108 Set your own admin site if it's different to usual *django.contrib.admin.site*::
110 QBE_ADMIN_SITE ="admin.admin_site"
112 Function to control to users with access to QBE::
114 QBE_ACCESS_FOR = lambda user: user.is_staff
116 Path to QBE formats export file, in order to add custom export formats::
118 QBE_FORMATS_EXPORT = "qbe_formats"
121 .. _QBE: http://www.google.com/url?sa=t&source=web&ct=res&cd=2&ved=0CB4QFjAB&url=http%3A%2F%2Fpages.cs.wisc.edu%2F~dbbook%2FopenAccess%2FthirdEdition%2Fqbe.pdf&ei=_UD5S5WSBYP5-Qb-18i8CA&usg=AFQjCNHMv-Pua285zhWT8DevuZFj2gfYKA&sig2=-sTEDWjJhnTaixh2iJfsAw
122 .. _PyPI: http://pypi.python.org/pypi/django_qbe/
123 .. _staticfiles: http://docs.djangoproject.com/en/dev/howto/static-files
125 Keywords: qbe django admin reports query sql
127 Classifier: Development Status :: 4 - Beta
128 Classifier: Framework :: Django
129 Classifier: Intended Audience :: Developers
130 Classifier: License :: OSI Approved :: GNU Affero General Public License v3
131 Classifier: Operating System :: OS Independent
132 Classifier: Programming Language :: JavaScript
133 Classifier: Programming Language :: Python
134 Classifier: Topic :: Internet :: WWW/HTTP