Commit Graph

611 Commits

Author SHA1 Message Date
Gary Reynolds 835c49b930 Update README.rst and setup.py
- update package classifiers to make the pyversions badge work
- add badges for PostgreSQL versions supported
2016-11-11 17:26:23 +11:00
Gary Reynolds 2190883129 Document a position on supported versions of Django & PostgreSQL
- policy for Django (all currently supported versions)
- policy for PostgreSQL (minimum version of latest Django version)

Upped the link to PostgreSQL's schema documentation to match new minimum (9.2).
2016-11-11 17:26:23 +11:00
Gary Reynolds 7d4428cc77 Merge pull request #402 from goodtune/issue-302
Refactor ImproperlyConfigured to system check framework
2016-11-11 17:24:06 +11:00
Gary Reynolds 7d2d8e8db5 Query the apps registry in test cases
The override_settings module looks after revising the cache, so no need to
build our own - the settings.INSTALLED_APPS was holding unexpected values
(strangely only in Python 3.5, though) but this should give the expected
outcome every time.
2016-11-11 17:17:08 +11:00
Gary Reynolds d935526c47 Flatten the app_configs to an INSTALLED_APPS list equivalence 2016-11-11 17:10:24 +11:00
Gary Reynolds 6df7a1c019 Adjust to check that tenant_schemas is listed first in INSTALLED_APPS
The Django documentation suggests that the correct way to overload
management commands with the same name is to load them earlier in the
INSTALLED_APPS list.
2016-11-11 07:57:14 +11:00
Gary Reynolds ea95f3f7a4 Refactor ImproperlyConfigured to system check framework
- ensure TENANT_APPS is defined in settings.py
- ensure TENANT_MODEL is defined in settings.py
- ensure TenantSyncRouter appears in DATABASE_ROUTERS
- ensure public schema and any existing tenant schemas are not listed in PG_EXTRA_SEARCH_PATHS
- raise error when TENANT_APPS is empty
- issue warning when 'tenant_schemas' is not the last item in INSTALLED_APPS
- issue warning when items in TENANT_APPS are not in INSTALLED_APPS
- add checks for SHARED_APPS
- add test cases for the best_practice system check
- update install documentation which previously suggested concatenation
- fix import path of get_public_schema_name
- fix failing test case for TenantContextFilter
- update tox.ini
- add .travis.yml
- PEP8 fixes
2016-11-11 07:57:14 +11:00
Gary Reynolds acb14ec5ce Add Travis CI badge to README 2016-11-11 07:34:01 +11:00
Gary Reynolds 206317ade2 Merge pull request #406 from jprashanth/indexes_introspection_pg96
Updated indexes ordering introspection for PostgreSQL 9.6
2016-11-11 06:24:17 +11:00
Prashanth Jonnala 9ba410f388 Updated indexes ordering introspection for PostgreSQL 9.6 2016-11-10 11:25:23 -05:00
Gary Reynolds 9b79674ff2 Merge pull request #404 from goodtune/travis-ci
Add travis-ci.org integration
2016-11-10 11:56:17 +11:00
Gary Reynolds ca7536be55 Add travis-ci.org integration 2016-11-10 11:53:50 +11:00
Gary Reynolds 55d51b2175 Merge pull request #403 from arkanus/python3
Modify tests to run and pass with python 3
2016-11-10 10:58:52 +11:00
Marcos Sánchez 6c2533cd54 Modify tests to run and pass with python 3 2016-11-08 23:21:35 -03:00
Bernardo Pires a43488ac04 Merge pull request #399 from farooqaaa/master
Removed quotes from username value for createsuperuser command
2016-10-22 07:44:11 +02:00
Farooq Azam 529361a85f Removed quotes from username value for createsuperuser command 2016-10-21 16:26:02 +05:00
Bernardo Pires fe35aeb46d Merge pull request #397 from anyeone/master
fixed error causing createsuperuser to fail for later versions of django
2016-10-08 16:11:05 +02:00
anye 8774cd499e removed comment per request 2016-10-07 14:28:55 -05:00
anye 4fb28368f6 fixed error that was causing createsuperuser to fail for later versions of django 2016-10-07 12:49:44 -05:00
Bernardo Pires ba73de494a Merge pull request #390 from filipeximenes/fast-testcase
Added FastTenantTestCase and its documentation
2016-10-04 23:03:47 +02:00
Filipe Ximenes 016e2682dd improving documentation texto for FastTenantTestCase 2016-10-04 17:34:46 -03:00
Bernardo Pires 906160f357 Update use.rst 2016-10-03 22:44:36 +02:00
Bernardo Pires 805d58a8fb Updated utils docs 2016-10-03 22:44:00 +02:00
Bernardo Pires 69f05c96ed Merge pull request #393 from bernardopires/revert-392-utils-docs
Revert "Documenting 'utils' module"
2016-10-03 22:38:53 +02:00
Bernardo Pires a4ad7980b9 Revert "Documenting 'utils' module" 2016-10-03 22:38:46 +02:00
Bernardo Pires 7ddba7a621 Merge pull request #392 from filipeximenes/utils-docs
Added documentation for 'utils' module
2016-10-03 22:24:35 +02:00
Filipe Ximenes fb2ec81d0f documenting 'utils' module 2016-10-03 11:22:06 -03:00
Filipe Ximenes a3b23d5f3a adding example on how to import FastTenantTestCase 2016-10-03 10:27:15 -03:00
Filipe Ximenes e9d90b6cd7 adding FastTenantTestCase and it's documentation 2016-10-03 10:24:09 -03:00
Bernardo Pires 0a9583e954 Now listing the correct context processor in the docs. Fixes #367. 2016-10-01 18:44:31 +02:00
Bernardo Pires cc437ed830 Remove line that says that contenttypes must be in TENANT_APPS. Fixes #369. 2016-10-01 18:42:24 +02:00
Bernardo Pires 366cbe3264 Fixed auto drop schema test 2016-09-30 00:08:40 +02:00
Bernardo Pires bfcd3103b8 Merge pull request #389 from bernardopires/revert-388-revert-385-master
Revert "Revert "Add UUIDField, some index introspections and fix migrations performance issue""
2016-09-29 23:58:58 +02:00
Bernardo Pires 84bd6d2ce8 Revert "Revert "Add UUIDField, some index introspections and fix migrations performance issue"" 2016-09-29 23:58:49 +02:00
Bernardo Pires dc442f41aa Added test for auto dropping schema when tenant deleted. Closes #378. 2016-09-29 23:42:32 +02:00
Bernardo Pires 97d42a1185 Merge pull request #388 from bernardopires/revert-385-master
Revert "Add UUIDField, some index introspections and fix migrations performance issue"
2016-09-29 23:29:15 +02:00
Bernardo Pires 2b0b52267b Revert "Add UUIDField, some index introspections and fix migrations performance issue" 2016-09-29 23:28:07 +02:00
Bernardo Pires 5e4bc12af1 Merge pull request #385 from mcanaves/master
Add UUIDField, some index introspections and fix migrations performance issue
2016-09-29 20:58:37 +02:00
Mateu Cànaves 76d74388cc Merge remote-tracking branch 'upstream/master' 2016-09-27 16:20:47 +02:00
Bernardo Pires a57d3ef363 Merge pull request #386 from goodtune/feature/logging-filter
Add TenantContextFilter for schema/domain logging
2016-09-26 10:28:38 +02:00
Gary Reynolds b62cbd7fba Add TenantContextFilter to test project settings 2016-09-26 07:49:51 +10:00
Justin Wunderle d9ce4ff99a Add TenantContextFilter - put schema_name and domain_url in log records
Add a LOGGING configuration similar to the section below.

    LOGGING = {
        'filters': {
            'tenant_context': {
                '()': 'tenant_schemas.log.TenantContextFilter',
            },
        },
        'formatters': {
            'default': {
                'format': '[%(schema_name)s:%(domain_url)s] '
                          '%(levelname)s %(asctime)s '
                          '%(message)s',
            },
        },
        'handlers': {
            'console': {
                'class': 'logging.StreamHandler',
                'formatter': 'default',
                'filters': ['tenant_context'],
            },
        },
    }

Your logging output will not look something like:

    [example:example.com] DEBUG 13:29 django.db.backends: (0.001) SELECT ...
2016-09-26 07:40:35 +10:00
Mateu Cànaves 0d01d49146 Merge remote-tracking branch 'upstream/master'
# Conflicts:
#	tenant_schemas/postgresql_backend/introspection.py
2016-09-23 12:47:24 +02:00
Mateu Cànaves 31a29a160e - Added introspection support for UUIDField.
- Added index order introspection.
- Added index type introspection.
- Allowed introspection to work regardless of table owner.
- Added introspection for expression-based index.
2016-09-23 12:14:31 +02:00
Mateu Cànaves ff232f278d Remove unused imports 2016-09-23 12:04:54 +02:00
Bernardo Pires eceab7a113 Merge pull request #384 from tonioo/master
Fix query performance when retrieving constraints (avoid full scan).
2016-09-23 10:48:07 +02:00
Antoine Nguyen e431105a4b Fix query performance (avoid full scan). 2016-09-23 09:41:38 +02:00
Mateu Cànaves 077b8c1b45 Style fix 2016-09-22 18:25:17 +02:00
Mateu Cànaves aa2f36a3a8 Fix typo 2016-09-22 16:10:44 +02:00
Bernardo Pires baf604644c Added missing schema exception for Django 1.8 2016-09-21 21:14:35 +02:00