1
0
mirror of https://github.com/django/django.git synced 2025-07-05 10:19:20 +00:00

1985 Commits

Author SHA1 Message Date
Jason Pellerin
a6064b22cf [multi-db] Added first request isolation tests (testing that database settings can safely change between requests).
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3391 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 22:22:31 +00:00
Jason Pellerin
b8cc6302a6 [multi-db] Fixed bug in request isolation of ConnectionInfoDescriptor.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3390 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 22:21:37 +00:00
Jason Pellerin
c705f3a573 [multi-db] Integrated drop table generation from ansi sql, updated model
connection name access to use django.db.model_connection_name().


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3389 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 18:59:50 +00:00
Jason Pellerin
58b24acdf4 [multi-db] Updated ansi sql test to reflect that drop table output is
not reversed by default.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3388 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 18:58:41 +00:00
Jason Pellerin
9b84da453e [multi-db] Removed reverse() from drop table output.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 18:58:03 +00:00
Jason Pellerin
d67abd9307 [multi-db] Moved ConnectionInfoDescriptor to django.db, updated imports
accordingly.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3386 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 18:57:26 +00:00
Jason Pellerin
5b6017edbf [multi-db] Moved ConnectionInfoDescriptor() from manager to django.db,
added model_connection_name() function in django.db.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 18:56:31 +00:00
Jason Pellerin
439b814afc [multi-db] Added workarounds for model-loading to allow in-module models to appear in get_models().
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3384 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 18:10:19 +00:00
Jason Pellerin
72b4c4c14a [multi-db] Made some minor formatting/line-length adjustments
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3383 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 18:09:32 +00:00
Jason Pellerin
cf48f3cc82 [multi-db] Fixed broken tests.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3382 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 16:40:16 +00:00
Jason Pellerin
89ec26a585 [multi-db] Updated runtests.py to load TEST_DATABASE_MODEL settings into
settings.OTHER_DATABASES before test run.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3381 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 16:38:57 +00:00
Jason Pellerin
c5d0e1ac56 [multi-db] Updated query builder functions to use
opts.get_default_manager() to access db connection where only options 
are available.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3380 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 14:58:46 +00:00
Jason Pellerin
32356827b4 [multi-db] Added weakref to model in Options (self._model) and method
Options.get_default_manager().


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3379 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 14:57:42 +00:00
Jason Pellerin
f350bcf058 [multi-db] Updated tests/othertests/manager_schema_manipulation to use OTHER_DATABASES settings and access db connection through model._default_manager.db.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3378 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 14:39:18 +00:00
Jason Pellerin
b8d27f0bcf [multi-db] Updated tests/othertests/ansi_sql.py to access db connection info through model._default_manager.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3377 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 14:30:00 +00:00
Jason Pellerin
6b63e852fc [multi-db] Began updating models.db.query to access connection through manager (work in progress).
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3370 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:46:18 +00:00
Jason Pellerin
f51a9fa30c [multi-db] Updated multiple_databases tests to use OTHER_DATABASES setting.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3369 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:43:38 +00:00
Jason Pellerin
a5caa0ab27 [multi-db] Added MODELS settings to TEST_DATABASES.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3368 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:41:56 +00:00
Jason Pellerin
ed4e198d11 Updated ansi sql schema builder to access db connection through model._default_manager.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3367 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:38:31 +00:00
Jason Pellerin
8b77fe3195 [multi-db] Updated related fields to get db connection from model._default_manager.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:36:45 +00:00
Jason Pellerin
62306542ee [multi-db] Updated Model and its utility functions to access the db connection through the default manager.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3365 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:32:40 +00:00
Jason Pellerin
e0486bd7a7 [multi-db] Removed connection information and db_connection from model Meta.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:31:44 +00:00
Jason Pellerin
22afa65b4b [multi-db] Added basic tests for Manager.db attribute.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3363 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:28:58 +00:00
Jason Pellerin
d96e3c93a5 [multi-db] Added ConnectionInfoDescriptor and attached it as db attribute in Manager class.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3361 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-19 02:28:24 +00:00
Jason Pellerin
541ac3b990 [multi-db] Merge trunk to [3354]
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3355 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-16 23:11:33 +00:00
Jason Pellerin
49ce784805 [multi-db] Changed name of optional named databases setting to
OTHER_DATABASES.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 20:38:27 +00:00
Jason Pellerin
97d1f60d77 [multi-db] Refactored connection handling to correct bugs in original
design relating to thread and request isolation. Changed name of 
optional named databases attribute in settings to 
settings.OTHER_DATABASES.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 20:37:07 +00:00
Jason Pellerin
c0132e88f6 [multi-db] Added preliminary drop-table generation to django.db.backends.ansi.sql.SchemaBuilder.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3320 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-11 03:16:28 +00:00
Jason Pellerin
3e562344ab [multi-db] Removed sql functions that have been moved to django.db.backends.ansi.sql.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3316 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-10 20:02:15 +00:00
Jason Pellerin
47d20cb5cf [multi-db] Updated django.core.management.get_sql_initial_data to use each model's connection info. Removed unused style argument from builder.get_initialdata.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3315 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-10 19:40:32 +00:00
Jason Pellerin
7ac06ee5be [multi-db] Minor refactoring: moved collation of sql statements by connection name to function.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3314 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-10 19:36:16 +00:00
Jason Pellerin
541f4e9671 [multi-db] Updated django.core.management.get_sql_indexes to use each model's connection info.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3313 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-10 19:27:40 +00:00
Jason Pellerin
ef1a9eeb64 [multi-db] Merge trunk to [3302]
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3303 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-09 17:11:34 +00:00
Jason Pellerin
60947322a5 [multi-db] Updated tests to expect pendings in dict format instead of
list.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3293 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-07 21:31:16 +00:00
Jason Pellerin
c1087076b4 [multi-db] Updated django.core.management to use pending dicts
correctly, and refactored get_sql_create() function to use manager and 
creation module builder as appropriate.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3292 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-07 21:30:03 +00:00
Jason Pellerin
bbc82d0c73 [multi-db] Updated Manager to use pendings dicts correctly, and added
get_table_list and get_installed_apps methods.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-07 21:28:47 +00:00
Jason Pellerin
774026e5c5 [multi-db] Added _app_model_order to django.db.models.loading, a dict of
models keyed by app label in which the models for the app are listed in 
the order in which they were created.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3290 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-07 21:27:27 +00:00
Jason Pellerin
0d9dee02bb [multi-db] Updated ansi sql SchemaBuilder to track pendings as dicts
keyed by the model they depend on.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3289 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-07 21:25:49 +00:00
Jason Pellerin
f043b395ba [multi-db] Fixed dummy backend DatabaseWrapper(): needs to accept settings argument like real backends.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3288 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-07 20:45:31 +00:00
Jason Pellerin
05086e5353 [multi-db] Added transaction and relation usage tests to multiple
databases model tests.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3281 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-06 21:45:52 +00:00
Jason Pellerin
062733a946 [multi-db] Began integrating Manager schema manipulation methods into django.core.management. Updated multiple db models test to include operations on installed models.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3267 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-03 20:57:52 +00:00
Jason Pellerin
f194f74aa6 [multi-db] Added install() and other schema manipulation methods to Manager. Fixed bug in manager assignment for inherited classes (objects and _default_manager in child class were still those belonging to parent class).
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3266 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-03 20:56:24 +00:00
Jason Pellerin
54d611d2a2 [multi-db] Added builder property to creation module of all backends. Currently for all backends builder is a django.db.backends.ansi.sql.SchemaBuilder.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3265 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-03 20:53:36 +00:00
Jason Pellerin
d2d269ea15 [multi-db] Made minor formatting updates. Added basic support for drop table, still needs to handle cascade.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3264 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-03 20:49:50 +00:00
Jason Pellerin
8f1d2bc98a [multi-db] Added TEST_DATABASES tuple to runtests.py. Now, databases in TEST_DATABASES will be created (if they don't exist or if the user accepts) at the start of the test run and dropped at the end. Those databases will be assigned to settings.DATABASES, with settings other than the database name inherited either from the DATABASES property in the active settings file (if it is present and contains a matching key) or from the default database settings.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3263 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-03 20:47:33 +00:00
Jason Pellerin
a206863cf6 [multi-db] Fix style handling: don't use mutable default style argument.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3262 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-03 16:58:31 +00:00
Jason Pellerin
2f44c9f24f [multi-db] Added django.db.backends.ansi.sql, with BoundStatement and SchemaBuilder classes that are used to construct the SQL for creating tables, indexes, etc. Added tests for basic table, relationship, index and initial data creation. Added supports_compound_statements flag to backends to avoid splitting initial data when not needed.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-03 16:53:50 +00:00
Jason Pellerin
1c6199dc87 [multi-db] Merge trunk to [3257]
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3258 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-03 14:23:39 +00:00
Jason Pellerin
4190c9e16f [multi-db] Added initialization code to runtests.py that creates
two named test databases, 'django_test_db_a' and 'django_test_db_b', 
along with the default test database. Moved multiple databases test to 
modeltests and reorganized it to match other model tests.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-30 18:03:56 +00:00
Jason Pellerin
763e087de1 [multi-db] Cleaned up settings access in ConnectionInfo.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3240 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-30 18:02:01 +00:00