{ "info": { "author": "Javier de la Rosa", "author_email": "versae@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: JavaScript", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "Django Query by Example (QBE)\n=============================\n\n:synopsis: Admin tool in order to get custom reports.\n\nThe objective of django-qbe is provide a assited and interactive way of making\ncomplex queries with no technical knowledge (or minimal) to get custom reports\nfrom the objects of Django models.\n\nBased on QBE_ proposal from IBM\u00ae, django-qbe is intended to remove the\nlimitations of Django QuerySets objects and to use the whole expresive power of\nthe subjacent SQL.\n\n\nInstallation\n------------\n\nUsing the Python Package Index (PyPI_) and easy_install script::\n\n $ easy_install django_qbe\n\nOr through pip::\n\n $ pip install django_qbe\n\nBut you also can download the ``django_qbe`` directory using git::\n\n $ git clone git://github.com/versae/qbe.git\n $ cp -r qbe/django_qbe /path/to/your/project\n\nAdding to the project settings::\n\n INSTALLED_APPS = (\n # [...] django builtins applications\n 'django_qbe',\n # [...] Any other application\n )\n\nAnd adding the urlconf in your project urls.py::\n\n # qbe\n url(r'^qbe/', include('django_qbe.urls')),\n\nAdd the context processor ``django.core.context_processors.static``::\n\n TEMPLATE_CONTEXT_PROCESSORS = (\n # [...] django context processors\n 'django.core.context_processors.static',\n # [...] Any other context processors\n )\n\nSee the `Django documentation on static files`__ for details.\n\n__ staticfiles_\n\nThat's all. Then you can access to http://host:port/qbe\nHowever, you can add a link from your admin page changing the admin index\ntemplate fo your AdminSite::\n\n class AdminSite(admin.AdminSite):\n index_template = \"qbe_index.html\"\n\nOr adding in your custom admin index template the next javascript::\n\n \n\nSaved queries\n^^^^^^^^^^^^^\n\nIf you optionally want to store queries in your database, feel free to\ninstall the also included app ``django_qbe.savedqueries``::\n\n INSTALLED_APPS = (\n # [...] django builtins applications\n 'django_qbe',\n 'django_qbe.savedqueries',\n # [...] Any other application\n )\n\nThen run the ``syncdb`` or optionally South_'s ``migrate`` management command\nto create the ``savedqueries_saved_query`` table.\n\nAfter that there will be a new option to save a query in a model instance and\nan admin interface to browse the saved queries, or direclty from the command\nline using the command ``qbe_export``::\n\n $ python manage.py help qbe_export\n $ python manage.py qbe_export \n $ python manage.py qbe_export --output test.csv\n $ python manage.py qbe_export --output test.xls --format xls\n $ python manage.py qbe_export --output test.xls --format xls --db-alias default\n\n.. _South: http://south.readthedocs.org/\n\nSettings\n--------\n\nThe next lines show de available settings and its default values.\n\nAdmin module name to add admin urls in results::\n\n QBE_ADMIN = \"admin\"\n\nSet your own admin site if it's different to usual *django.contrib.admin.site*::\n\n QBE_ADMIN_SITE =\"admin.admin_site\"\n\nFunction to control to users with access to QBE::\n\n QBE_ACCESS_FOR = lambda user: user.is_staff\n\nSome options for the query builder form::\n\n QBE_ALIASES = False # It allows to add an alias to a model field\n QBE_GROUP_BY = False # It allows to group by in a query\n QBE_SHOW_ROW_NUMBER = True # It disables number rows in results\n\nPath to QBE formats export file, in order to add custom export formats::\n\n QBE_FORMATS_EXPORT = \"qbe_formats\"\n\nPath to custom QBE operators for the criteria::\n\n QBE_CUSTOM_OPERATORS = \"qbe_operators\"\n\nCustom Operators\n--------\n\nUse Custom Operators only if you know what you are doing and at your own risks!\n\nIf you need to define custom operators, in a file ``qbe_operators.py`` in your\nproject root, you need to create a new class that extends\n``django_qbe.operators.CustomOperator``::\n\n import datetime\n from django.utils import timezone\n from django_qbe.operators import CustomOperator\n\n\n class SinceDaysAgo(CustomOperator):\n slug = 'since-days-ago' # REQUIRED and must be unique\n label = 'Since Days Ago' # REQUIRED\n\n def get_params(self):\n if len(self.params):\n return self.params\n\n now = timezone.now()\n today = now.replace(hour=0, minute=0, second=0, microsecond=0)\n tomorrow = today + datetime.timedelta(days=1)\n\n date_since = today - datetime.timedelta(days=int(self.value))\n\n operator = \"gt\"\n lookup_since = self._get_lookup(operator, str(date_since))\n lookup_until = self._get_lookup(operator, str(tomorrow))\n\n self.params.append(lookup_since)\n self.params.append(lookup_until)\n\n return self.params\n\n def get_wheres(self):\n if len(self.wheres):\n return self.wheres\n\n lookup_cast = self._db_operations.lookup_cast\n for operator in [\"gte\", \"lt\"]:\n db_operator = self._db_operators[operator]\n self.wheres.append(u\"%s %s\" % (\n lookup_cast(operator) % self.db_field,\n db_operator)\n )\n\n return self.wheres\n\nYour custom operator must have 2 attributes, ``slug`` and ``label`` in order\nto be displayed in the Criteria dropdown.\n\nThe ``get_params`` and ``get_wheres`` methods must return an iterable instance\n(eg. list), otherwise it gets converted to a list.\n\nIf you dont want to write it in your ``models.py`` make sure that it is\nimported in one of the files that are evaluated at runtime (eg. ``models.py``\nor ``urls.py``) in order to register your Custom Operator.\n\n.. _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\n.. _PyPI: http://pypi.python.org/pypi/django_qbe/\n.. _staticfiles: http://docs.djangoproject.com/en/dev/howto/static-files/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://versae.github.com/qbe/", "keywords": "qbe django admin reports query sql", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django_qbe", "package_url": "https://pypi.org/project/django_qbe/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django_qbe/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://versae.github.com/qbe/" }, "release_url": "https://pypi.org/project/django_qbe/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "Django admin tool for custom reports", "version": "0.3.0" }, "last_serial": 1371531, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "1c500c37206911afdd726762ee6fcbc3", "sha256": "b4e926eb4d7e4d395c23179ebefa4591dac2b11002ec32b2ca9e3ec7c712005b" }, "downloads": -1, "filename": "django_qbe-0.1.0.tar.gz", "has_sig": false, "md5_digest": "1c500c37206911afdd726762ee6fcbc3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 132709, "upload_time": "2010-11-23T04:27:34", "url": "https://files.pythonhosted.org/packages/6f/61/3413bd6efddb32fb479a3ed0dea46cd02c0ab8bd60226fda07221a21be1c/django_qbe-0.1.0.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "0b1f8897040939bbb56d040ec39f8661", "sha256": "0c13f496eacd2f587510b88114b56692c94ffb8ac04723ac5e950bbfe816a86f" }, "downloads": -1, "filename": "django_qbe-0.1.2.tar.gz", "has_sig": false, "md5_digest": "0b1f8897040939bbb56d040ec39f8661", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 134055, "upload_time": "2011-03-03T23:03:58", "url": "https://files.pythonhosted.org/packages/7c/93/70e8786678cc1eb62b2c06f3e205676ca238a835a5978dd903cff90f24f6/django_qbe-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "4e0a610e1c469027788ee36067db9420", "sha256": "ffa157cc15b5702ba434f0a48aa83af1e24a23302b966d546537ff8e4f015cb1" }, "downloads": -1, "filename": "django_qbe-0.1.3.tar.gz", "has_sig": false, "md5_digest": "4e0a610e1c469027788ee36067db9420", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 134649, "upload_time": "2011-03-15T17:50:53", "url": "https://files.pythonhosted.org/packages/f8/e0/f87a927cdd25043df3fb32d0cf3db78c61b22263654f2abddfe146014462/django_qbe-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "6bb2097109b5c5eeda25639031f85f92", "sha256": "1396e03f655b10024a9486022de6854d431e912f591d7d6c7900f7d62f6db13d" }, "downloads": -1, "filename": "django_qbe-0.1.4.tar.gz", "has_sig": false, "md5_digest": "6bb2097109b5c5eeda25639031f85f92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 134794, "upload_time": "2011-03-16T23:37:46", "url": "https://files.pythonhosted.org/packages/84/fe/2cebdc785d1b1709a9fd300b0e8a5e6fd004e555178e7f4f3c5593586f79/django_qbe-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "db7219c0db4aa0ded93d0447ed2e237d", "sha256": "32c7f42fd4c03ac84a27c1d6cc26ed8c9c2e981ad6a268b277001a12dd9a9028" }, "downloads": -1, "filename": "django_qbe-0.1.5.tar.gz", "has_sig": false, "md5_digest": "db7219c0db4aa0ded93d0447ed2e237d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 161087, "upload_time": "2011-04-07T18:55:09", "url": "https://files.pythonhosted.org/packages/73/c1/98098c64729c210249643e53c2f4e5f927e36a24a44ae8a36e9ba90bda48/django_qbe-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "27523c3f24a69818f84f3f2282ea1d04", "sha256": "4524dad1776795142e9b5292292945e16a0ab1c37deaca2ce4b4d5d36a216cc8" }, "downloads": -1, "filename": "django_qbe-0.1.6.tar.gz", "has_sig": false, "md5_digest": "27523c3f24a69818f84f3f2282ea1d04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46842, "upload_time": "2011-05-20T07:57:06", "url": "https://files.pythonhosted.org/packages/06/0d/e72a2e2e44601e4fc4c04337b88cd9a4b9024243a1123fc76fbe0c78ed6a/django_qbe-0.1.6.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "fcb096a1e630d37f92a0eac92d43951d", "sha256": "8ffb0bf4059e709361e8638f7996fdc9b664c09518989506eb3b63d99baaaade" }, "downloads": -1, "filename": "django_qbe-0.2.0.tar.gz", "has_sig": false, "md5_digest": "fcb096a1e630d37f92a0eac92d43951d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 144112, "upload_time": "2012-12-13T00:12:38", "url": "https://files.pythonhosted.org/packages/b4/08/54d2091e74c7e4c10dac72de19cafb4f87fbf465ecc4ecb5941ef3d7474a/django_qbe-0.2.0.tar.gz" } ], "0.2.0a2": [ { "comment_text": "", "digests": { "md5": "70a06e811a09d26258abb72a253651b0", "sha256": "f541b52c13042588e2880e768c19251f2e862a01688982fb22769ada67228047" }, "downloads": -1, "filename": "django_qbe-0.2.0a2.tar.gz", "has_sig": false, "md5_digest": "70a06e811a09d26258abb72a253651b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 144109, "upload_time": "2012-12-13T00:09:23", "url": "https://files.pythonhosted.org/packages/22/0b/0c95336bbd82346f42b778870a081d4f5c4c75859acae0a8823d6ec6949c/django_qbe-0.2.0a2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "d163042f2cc58ba9cbcdf969228d9042", "sha256": "92ec90f15d739e981f9fe2a4202ace4f47678b59cf84b3fef4e97670795a6b96" }, "downloads": -1, "filename": "django_qbe-0.3.0.tar.gz", "has_sig": false, "md5_digest": "d163042f2cc58ba9cbcdf969228d9042", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 143484, "upload_time": "2015-01-05T18:34:34", "url": "https://files.pythonhosted.org/packages/32/21/e815fe6e408eb9d30c5d3960848653142959f77005e3ec9445fa54f9349b/django_qbe-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d163042f2cc58ba9cbcdf969228d9042", "sha256": "92ec90f15d739e981f9fe2a4202ace4f47678b59cf84b3fef4e97670795a6b96" }, "downloads": -1, "filename": "django_qbe-0.3.0.tar.gz", "has_sig": false, "md5_digest": "d163042f2cc58ba9cbcdf969228d9042", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 143484, "upload_time": "2015-01-05T18:34:34", "url": "https://files.pythonhosted.org/packages/32/21/e815fe6e408eb9d30c5d3960848653142959f77005e3ec9445fa54f9349b/django_qbe-0.3.0.tar.gz" } ] }