1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

1961 Commits

Author SHA1 Message Date
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
Jason Pellerin
3d8ebb3bec [multi-db] Added DATABASES = {} to global_settings
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-30 18:00:58 +00:00
Jason Pellerin
a50d895f28 [multi-db] Updated tests/runtests.py to create test databases for all
named connections (if any) in addition to the default connection. 
Updated LazyConnectionManager to allow assignment to connection names. 


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3238 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-29 22:00:25 +00:00
Jason Pellerin
75b64abaa7 [multi-db] Added optional db_connection property to model Meta classes,
which can be used to set the name of the connection for the  model. 
Updated query generation in model, query and fields/related to 
use the model's connection and backend. Added basic model connection 
access to multiple db test.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3234 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 22:21:45 +00:00
Jason Pellerin
9bae64fa76 [multi-db] Added connections parameter to transaction
functions, where appropriate, to allow specifying which connections to 
commit or rollback.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 21:38:04 +00:00
Jason Pellerin
68cc8a1131 Added basic tests for settings.DATABASES populating
django.db.connections with lazy db connections. 


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 19:26:33 +00:00
Jason Pellerin
966df94e75 Removed redundant error check.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3230 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 18:41:07 +00:00
Jason Pellerin
f19713f56f * Added connect() function and ConnectionInfo class to abstract
connection-establishment mechanics.
 * In backends, added required settings parameter to DatabaseWrapper(), so 
that connections can keep track of their settings.


git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3229 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 18:35:43 +00:00
Jason Pellerin
da5b0586d3 Merge trunk to [3226]
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 17:07:26 +00:00
Jason Pellerin
54b6e96957 Merge trunk to [3216]
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28 17:00:52 +00:00
Jacob Kaplan-Moss
1184850665 Created branch for MultipleDatabaseSupport. Refs #1142.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-23 19:17:02 +00:00
Russell Keith-Magee
dc473309ef Fixed #1661 -- Added logic for string-form model references in the 'to' argument of OneToOneFields. Includes regression test.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3197 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-23 08:16:36 +00:00
Russell Keith-Magee
6cbdbffc80 Added comments to clarify the string->field name resolution logic.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3196 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-23 07:43:33 +00:00
Russell Keith-Magee
0d4b5b9b4a Fixed #1662 -- Added resolver for string-form model references for models that have already been loaded, with tests to validate both forward and backward referenced model names. Light refactoring of model loading to make regression tests behave more like normal model loading. Also clarifies the text of some validation errors.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-23 04:37:00 +00:00
Jacob Kaplan-Moss
bc2d8cdbc6 Fixed #2199: deleting objects with generic foreign keys in the admin now works. Thanks, Jay Parlar
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3194 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-22 18:44:06 +00:00
Adrian Holovaty
10229c4a1e Changed default 500 view NOT to use RequestContext, to lessen the chance that the 500 view would raise an error in itself
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-22 16:28:40 +00:00
Adrian Holovaty
d8acac975a Fixed typo in docs/request_response.txt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3192 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-22 04:56:35 +00:00
Jacob Kaplan-Moss
a490d6b4f6 Fixed a few small rst errors in request/response and fastcgi docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3191 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 23:06:24 +00:00
Adrian Holovaty
a159f660fe Reverted [3184]. There's no such thing as models.PasswordField.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3189 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 14:42:52 +00:00
Malcolm Tredinnick
68cfd446a3 Fixed the "timeuntil" and "timesince" tests so that they don't fail on a
machine under heavy load.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3188 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 12:11:00 +00:00
Malcolm Tredinnick
3465a4f6f4 Fixed #1240 -- Updated bash completion file to accomodate changes in r3174.
Thanks, Paolo.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3187 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 11:15:01 +00:00
Malcolm Tredinnick
ae1234f2a2 Fixed #2163 -- Corrected typo when handling datetimes with timezones in the timesince filter. Thanks, Alex Dedul.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 11:11:03 +00:00
Malcolm Tredinnick
239adf83d3 Fixed #2053 -- added an optional comparison argument to the "timesince" filter.
Added a "timeuntil" filter that works analogously. Thanks, john@sneeu.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 06:56:08 +00:00
Malcolm Tredinnick
c4fa8a158a Fixed #2071 -- documented the PasswordField (including cavaets). Thanks to
asmodai for the initial patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3184 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 04:49:12 +00:00
Malcolm Tredinnick
b70a687777 Fixed #2031 -- Don't try to remove microseconds on date objects (only datetime)
for MySQL. Refs #316.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-21 04:13:48 +00:00