django-json-dbindex¶
Describe your database index in json files into your apps
Detailed documentation is in the “docs” directory.
Quick start¶
Add “json_dbindex” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = ( ... 'json_dbindex', )
Run python manage.py list_jsindex to list all defined indexes.
Create indexes¶
Create a file in you app directory called dbindex_create.json with following contents
- [{“name”: “django_site_composite_idx”,
- “table”: “django_site”, “column”: [“domain”,”name”], “predicat”: “WHERE id > 1000”, “using”: “btree”, “database”: “default”, “unique”: yes}]
Trying to create an existing index will not generate an error, only a logging at level notice will be raised.
Drop indexes¶
Create a file in you app directory called dbindex_drop.json with following contents.
- [{“name”: “django_site_composite_idx”},
- {“name”: “django_site_domain_idx”}]
Only the name is required. In the above example two indexes will be dropped. Trying to drop a non existing index will not generate an error, only a logging at level notice will be raised.
Contents¶
Install¶
django-json-dbindex is open-source software, published under BSD license. See License for details.
If you want to install a development environment, you should go to Contributing documentation.
Prerequisites¶
As a library¶
In most cases, you will use django-json-dbindex as a dependency of another project. In such a case, you should add django-json-dbindex in your main project’s requirements. Typically in setup.py:
from setuptools import setup
setup(
install_requires=[
'django-json-dbindex',
#...
]
# ...
)
Then when you install your main project with your favorite package manager (like pip [2]), django-json-dbindex will automatically be installed.
Standalone¶
You can install django-json-dbindex with your favorite Python package manager. As an example with pip [2]:
pip install django-json-dbindex
Check¶
Check django-json-dbindex has been installed:
python -c "import django_json_dbindex;print(django_json-dbindex.__version__)"
You should get django_json_dbindex‘s version.
References
[1] | https://www.python.org/ |
[2] | (1, 2) https://pypi.python.org/pypi/pip/ |
About django-docusign¶
This section is about the django-docusign project itself.
Vision¶
django-json-dbindex helps you integrate and use complex indexes within a Django project.
License¶
Copyright (c) 2014, Rodolphe Quiédeville. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of django-json-dbindex nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Authors & contributors¶
Maintainer: Rodolphe Quiédeville <rodolphe@quiedeville.org>, as a member of the PeopleDoc [1] team: https://github.com/novapost/
Developers: https://github.com/novapost/django-json-dbindex/graphs/contributors
Notes & references
[1] | http://www.people-doc.com |
Changelog¶
This document describes changes between each past release. For information about future releases, check milestones [1] and Vision.
1.1.0 (2014-11-24)¶
- Thanks to Bruno Bord, management commands now use stdout instead of print
1.0.2 (2014-11-14)¶
- FIX create_index and drop_index when database is not set
1.0.1 (2014-11-14)¶
- FIX index_exists
1.0.0 (2014-11-14)¶
- support multi database
0.0.2 (2014-09-29)¶
- FIX changelog dates
- FIX error in util.get_app_paths
0.0.1 (2014-09-29)¶
Initial release.
- First release of django-json-dbindex, compatibility with PostgreSQL only.
Notes & references
[1] | https://github.com/novapost/django-json-dbindex/milestones |
Contributing¶
This document provides guidelines for people who want to contribute to the django-json-dbindex project.
Create tickets¶
Please use django-json-dbindex bugtracker [1] before starting some work:
- check if the bug or feature request has already been filed. It may have been answered too!
- else create a new ticket.
- if you plan to contribute, tell us, so that we are given an opportunity to give feedback as soon as possible.
- Then, in your commit messages, reference the ticket with some refs #TICKET-ID syntax.
Use topic branches¶
- Work in branches.
- Prefix your branch with the ticket ID corresponding to the issue. As an example, if you are working on ticket #23 which is about contribute documentation, name your branch like 23-contribute-doc.
- If you work in a development branch and want to refresh it with changes from master, please rebase [2] or merge-based rebase [3], i.e. do not merge master.
Fork, clone¶
Clone django-json-dbindex repository (adapt to use your own fork):
git clone git@github.com:novapost/django-json-dbindex.git
cd django-json-dbindex/
Usual actions¶
The Makefile is the reference card for usual actions in development environment:
- Install development toolkit with pip [4]: make develop.
- Run tests with tox [5]: make test.
- Build documentation: make documentation. It builds Sphinx [6] documentation in var/docs/html/index.html.
- Release django-json-dbindex project with zest.releaser [7]: make release.
- Cleanup local repository: make clean, make distclean and make maintainer-clean.
See also make help.
Notes & references
[1] | https://github.com/novapost/django-json-dbindex/issues |
[2] | http://git-scm.com/book/en/Git-Branching-Rebasing |
[3] | http://tech.novapost.fr/psycho-rebasing-en.html |
[4] | https://pypi.python.org/pypi/pip/ |
[5] | https://pypi.python.org/pypi/tox/ |
[6] | https://pypi.python.org/pypi/Sphinx/ |
[7] | https://pypi.python.org/pypi/zest.releaser/ |