Commit Graph

62 Commits

Author SHA1 Message Date
Aymeric Augustin e654180ce2 Improved the API of set_autocommit. 2013-03-11 15:10:58 +01:00
Aymeric Augustin 14aa563f51 Removed superfluous code now that connections use autocommit by default. 2013-03-11 14:48:54 +01:00
Aymeric Augustin f515619494 Added an API to control database-level autocommit. 2013-03-11 14:48:53 +01:00
Anssi Kääriäinen 50328f0a61 Fixed #19861 -- Transaction ._dirty flag improvement
There were a couple of errors in ._dirty flag handling:
  * It started as None, but was never reset to None.
  * The _dirty flag was sometimes used to indicate if the connection
    was inside transaction management, but this was not done
    consistently. This also meant the flag had three separate values.
  * The None value had a special meaning, causing for example inability
    to commit() on new connection unless enter/leave tx management was
    done.
  * The _dirty was tracking "connection in transaction" state, but only
    in managed transactions.
  * Some tests never reset the transaction state of the used connection.
  * And some additional less important changes.

This commit has some potential for regressions, but as the above list
shows, the current situation isn't perfect either.
2013-02-27 17:54:27 +02:00
Tomasz Rybak d7429defe6 Add sqldropindexes to manage
Change patch from https://code.djangoproject.com/ticket/5568
to work on modern Django.
Add special case for MySQL which has different syntax for DROP INDEX.
Add unit tests for the new functionality.
2013-02-24 12:38:28 +01:00
Alex Gaynor b55cde054e Added a db_constraint option to ForeignKeys.
This controls whether or not a database level cosntraint is created. This is useful in a few specialized circumstances, but in general should not be used!
2013-02-20 11:27:32 -08:00
Claude Paroz e486475a13 Moved import in db.backends.creation 2013-02-08 10:01:56 +01:00
Aymeric Augustin f46d7314b5 Fixed #19677 -- Introspection of recursive foreign keys under SQLite.
Thanks Simon Charette.
2013-01-28 10:17:56 +01:00
Anssi Kääriäinen 905ea9619b Made sure global settings are changed in test db creation
There was an assumption that changing connection.settings_dict changed
also the settings.DATABASES values. This assumption is now gone.
2012-11-27 19:47:20 +02:00
Alex Gaynor 4285571c5a Fixed #5805 -- it is now possible to specify multi-column indexes. Thanks to jgelens for the original patch. 2012-11-04 10:16:06 -08:00
Russell Keith-Magee 70a0de37d1 Fixed #3011 -- Added swappable auth.User models.
Thanks to the many people that contributed to the development and review of
this patch, including (but not limited to) Jacob Kaplan-Moss, Anssi
Kääriäinen, Ramiro Morales, Preston Holmes, Josh Ourisman, Thomas Sutton,
and Roger Barnes, as well as the many, many people who have contributed to
the design discussion around this ticket over many years.

Squashed commit of the following:

commit d84749a0f0
Merge: 531e771 7c11b1a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Wed Sep 26 18:37:04 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 531e7715da
Merge: 29d1abb 1f84b04
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Wed Sep 26 07:09:23 2012 +0800

    Merged recent trunk changes.

commit 29d1abbe35
Merge: 8a527dd 54c81a1
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Sep 24 07:49:46 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 8a527dda13
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Sep 24 07:48:05 2012 +0800

    Ensure sequences are reset correctly in the presence of swapped models.

commit e2b6e22f29
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 23 17:53:05 2012 +0800

    Modifications to the handling and docs for auth forms.

commit 98aba856b5
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 23 15:28:57 2012 +0800

    Improved error handling and docs for get_user_model()

commit 0229209c84
Merge: 6494bf9 8599f64
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 23 14:50:11 2012 +0800

    Merged recent Django trunk changes.

commit 6494bf91f2
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Sep 17 21:38:44 2012 +0800

    Improved validation of swappable model settings.

commit 5a04cde342
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Sep 17 07:15:14 2012 +0800

    Removed some unused imports.

commit ffd535e413
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 20:31:28 2012 +0800

    Corrected attribute access on for get_by_natural_key

commit 913e1ac84c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 20:12:34 2012 +0800

    Added test for proxy model safeguards on swappable models.

commit 280bf19e94
Merge: dbb3900 935a863
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 18:16:49 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit dbb3900775
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 18:09:27 2012 +0800

    Fixes for Python 3 compatibility.

commit dfd72131d8
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 15:54:30 2012 +0800

    Added protection against proxying swapped models.

commit abcb027190
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 15:11:10 2012 +0800

    Cleanup and documentation of AbstractUser base class.

commit a9491a8776
Merge: fd8bb4e 08bcb4a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 14:46:49 2012 +0800

    Merge commit '08bcb4aec1ed154cefc631b8510ee13e9af0c19d' into t3011

commit fd8bb4e3e4
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 14:20:14 2012 +0800

    Documentation improvements coming from community review.

commit b550a6d06d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 13:52:47 2012 +0800

    Refactored skipIfCustomUser into the contrib.auth tests.

commit 52a02f1110
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 13:46:10 2012 +0800

    Refactored common 'get' pattern into manager method.

commit b441a6bbc7
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 16 13:41:33 2012 +0800

    Added note about backwards incompatible change to admin login messages.

commit 08bcb4aec1
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Sep 15 18:30:33 2012 +0300

    Splitted User to AbstractUser and User

commit d9f5e5addb
Author: Anssi Kääriäinen <akaariai@gmail.com>
Date:   Sat Sep 15 18:30:02 2012 +0300

    Reworked REQUIRED_FIELDS + create_user() interaction

commit 579f152e4a
Merge: 9184972 93e6733
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 20:18:37 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 918497218c
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 20:18:19 2012 +0800

    Deprecate AUTH_PROFILE_MODULE and get_profile().

commit 334cdfc1bb
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 20:00:12 2012 +0800

    Added release notes for new swappable User feature.

commit 5d7bb22e8d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 19:59:49 2012 +0800

    Ensure swapped models can't be queried.

commit 57ac6e3d32
Merge: f2ec915 abfba3b
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 15 14:31:54 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit f2ec915b20
Merge: 1952656 5e99a3d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 9 08:29:51 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 19526563b5
Merge: 2c5e833 c4aa26a
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 9 08:22:26 2012 +0800

    Merge recent changes from master.

commit 2c5e833a30
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 9 07:53:46 2012 +0800

    Corrected admin_views tests following removal of the email fallback on admin logins.

commit 20d1892491
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sun Sep 9 01:00:37 2012 +0800

    Added conditional skips for all tests dependent on the default User model

commit 40ea8b8882
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 8 23:47:02 2012 +0800

    Added documentation for REQUIRED_FIELDS in custom auth.

commit e6aaf65970
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Sat Sep 8 23:20:02 2012 +0800

    Added first draft of custom User docs.

    Thanks to Greg Turner for the initial text.

commit 75118bd242
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date:   Mon Aug 20 11:17:26 2012 +0800

    Admin app should not allow username discovery

    The admin app login form should not allow users to discover the username
    associated with an email address.

commit d088b3af58
Author: Thomas Sutton <me@thomas-sutton.id.au>
Date:   Mon Aug 20 10:32:13 2012 +0800

    Admin app login form should use swapped user model

commit 7e82e83d67
Merge: e29c010 39aa890
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Fri Sep 7 23:45:03 2012 +0800

    Merged master changes.

commit e29c010beb
Merge: 8e3fd70 30bdf22
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Aug 20 13:12:57 2012 +0800

    Merge remote-tracking branch 'django/master' into t3011

commit 8e3fd703d0
Merge: 507bb50 26e0ba0
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Aug 20 13:09:09 2012 +0800

    Merged recent changes from trunk.

commit 507bb50a92
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Jun 4 20:41:37 2012 +0800

    Modified auth app so that login with alternate auth app is possible.

commit dabe362836
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Jun 4 20:10:51 2012 +0800

    Modified auth management commands to handle custom user definitions.

commit 7cc0baf89d
Author: Russell Keith-Magee <russell@keith-magee.com>
Date:   Mon Jun 4 14:17:28 2012 +0800

    Added model Meta option for swappable models, and made auth.User a swappable model
2012-09-26 18:48:09 +08:00
Alex Gaynor ad50243cd1 [py3k] Fixed the index creation code that I committed a few minutes ago for py3k. 2012-09-07 15:33:02 -04:00
Alex Gaynor e4ea536774 Ensued that SQL indexes are alwasy created in the same name.
Previous this used Python's builtin hash() function, which has never been guarnteed to be stable across implementations (CPython/Jython/etc.) or 32/64 bitness. However, this in practice it was stable. However, with the impending release of Python 3.3 hash randomizations is enabled by default, which would mean the index name changed between program invocations.
2012-09-07 14:14:06 -04:00
Claude Paroz b8e49d70f2 [py3] Replaced raw_input by input
The six addition has been borrowed from:
https://bitbucket.org/gutworth/six/changeset/733ef740
2012-08-08 19:53:11 +02:00
Aymeric Augustin 56dbe924a6 [py3] Removed longs. 2012-07-22 09:29:53 +02:00
Claude Paroz aa423575e7 Fixed #17760 -- Implemented callable database features as cached properties
This does remove the requirement to call features.confirm() method
before checking the properties.
Thanks cdestiger and Ramiro Morales for their work on the patch.
2012-06-09 15:59:52 +02:00
Claude Paroz 596cb9c7e2 Replaced print statement by print function (forward compatibility syntax). 2012-04-30 20:45:03 +02:00
Claude Paroz 3904b74a3f Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-04-29 20:57:15 +02:00
Anssi Kääriäinen 584e2c0337 Prevent Oracle from changing field.null to True
Fixed #17957 -- when using Oracle and character fields, the fields
were set null = True to ease the handling of empty strings. This
caused problems when using multiple databases from different vendors,
or when the character field happened to be also a primary key.

The handling was changed so that NOT NULL is not emitted on Oracle
even if field.null = False, and field.null is not touched otherwise.

Thanks to bhuztez for the report, ramiro for triaging & comments,
ikelly for the patch and alex for reviewing.
2012-04-29 19:25:46 +03:00
Aymeric Augustin 97061bdf30 Fixed #17786 (again) -- Ensured destruction of test databases works under Oracle, even with multiple databases, after r17411.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-02-28 21:23:45 +00:00
Julien Phalip f1dc83cb98 Fixed #10868 -- Stopped restoring database connections after the tests' execution in order to prevent the production database from being exposed to potential threads that would still be running. Also did a bit of PEP8-cleaning while I was in the area. Many thanks to ovidiu for the report and to Anssi Kääriäinen for thoroughly investigating this issue.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-30 08:27:50 +00:00
Aymeric Augustin d0eb4693ab Fixed #15255 -- Ensured createcachetable honors database routers.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17114 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-19 19:56:31 +00:00
Aymeric Augustin 246580573d Fixed #12308 -- Added tablespace support to the PostgreSQL backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-14 21:49:43 +00:00
Carl Meyer f91af72523 Fixed #16353 -- don't try to create Site objects on all databases. Refs #15573, #15346. Thanks Aymeric Augustin for the report and the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16868 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-21 22:46:48 +00:00
Alex Gaynor 345c4c4629 Remove a bunch of deadcode/dead imports.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16794 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-10 22:31:38 +00:00
Ramiro Morales 569aa34ea5 Fixed #16250 -- Made test database creation support code in the PostgreSQL DB backend compatible with psycopg2 2.4.2.
Implemented this by adding an internal hook for work that should be performed
before that point.

Also, regarding the `DatabaseCreation.set_autocommit()` method:
 * Stop using it for such tasks
 * Stop providing an implementation that tries to cover all the possible
   idioms a third party database backend DB-API 2 driver could need to activate
   autocommit. It is now left for third party backends to implement.

This can be backwards incompatible in the case of user applications that:
 * Had started using this method
 * Use a third a party database backend

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-06 23:25:30 +00:00
Jannis Leidel 89c302cf3f Rolled back r16510, r16513 and r16514 because it wasn't ready.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16515 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-05 14:16:37 +00:00
Jannis Leidel 6de65ab76f Fixed #15255 -- Stopped database cache from ignoring database routers when creating the cache table. Thanks, aaugustin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-04 21:53:17 +00:00
Ian Kelly d3c08fd813 Fixed #15573: Forced the default site id to be 1 when creating test databases, to prevent a large number of errors when running the tests using the oracle backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16027 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-15 21:49:22 +00:00
Russell Keith-Magee f9972bcf86 Removed deprecated DB backend functions for creating m2m tables.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15979 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-02 08:38:25 +00:00
Ramiro Morales dc5f2607de Fixed #15029 -- Moved to database backends the ability to decide if two DATABASES items are different when creating temporary databases for tests.
hG: Enter commit message.  Lines beginning with 'HG:' are removed.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15392 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-02 14:02:14 +00:00
Russell Keith-Magee b31a1b9926 Refs #14661 -- Clarified the handling of initial data injected via custom SQL.
This is BACKWARDS INCOMPATIBLE CHANGE for anyone relying on SQL-injected initial data in a test case.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-18 16:43:01 +00:00
Luke Plant 363177ea32 Small performance tweak - avoid loading django.core.management in DB backend code
django.core.management (and dependencies) will usually not be needed in a web context.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15012 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21 21:32:59 +00:00
Russell Keith-Magee 673e6fc7fb Fixed #11675 -- Added support for the PyLibMC cache library. In order to support this, and clean up some other 1.3 caching additions, this patch also includes some changes to the way caches are defined. This means you can now have multiple caches, in the same way you have multiple databases. A huge thanks to Jacob Burch for the work on the PyLibMC backend, and to Jannis for his work on the cache definition changes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21 15:19:19 +00:00
Ramiro Morales c2657d8923 Fixed #14921 -- Tweak changes made in r14861 for the Oracle backend so the test runner can actually create the test DB. Thanks Karen for the report.
In Oracle, the name of a DB as handled by Django hasn't a counterpart anyway. So use the 'production DB name' as it was done before.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14993 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-21 01:36:09 +00:00
Ramiro Morales e0d8c5fca2 Fixed error introduced in r14666 that results in the message reporting the test DB name to be created being shown actually after the real action when the operation fails.
Implemented that by factoring out calculation of test DB name to an internal method.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-08 23:48:28 +00:00
Ramiro Morales 752bd8bf75 Added printing of the name of test database being created/destroyed, at verbosity level 2. Refs #14415.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14666 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-21 17:18:26 +00:00
Russell Keith-Magee 121d2e3678 Fixed #12991 -- Added unittest2 support. Thanks to PaulM for the draft patch, and to Luke, Karen, Justin, Alex, Łukasz Rekucki, and Chuck Harmston for their help testing and reviewing the final patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-11 12:55:17 +00:00
Russell Keith-Magee 1070c57b83 Fixed #14436 -- Escalated 1.2 PendingDeprecationWarnings to DeprecationWarnings, and removed 1.1 deprecated code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14138 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-11 12:20:07 +00:00
Russell Keith-Magee 72dc12ed06 Rationalized the verbosity levels (including introducing a new super-verbose level) for syncdb, test and loaddata.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-07 06:58:14 +00:00
Russell Keith-Magee fc374976e5 Fixed #13946 -- Modified the database cache backend to use the database router to determine availability of the cache table. Thanks to tiemonster for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13473 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-05 02:13:32 +00:00
Russell Keith-Magee 5211f48ae3 Fixed #12164 -- Removed the Python 2.3 compatibility imports and workarounds. Thanks to timo and claudep for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04 14:00:30 +00:00
Russell Keith-Magee 9d8492c169 Fixed #12977 -- Ensure that indexes don't exceed character limits on MySQL. Thanks to carljm for the original report, and hgeerts@osso.nl for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13040 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-28 12:08:30 +00:00
Russell Keith-Magee 3fb57d47bd Fixed #13328 -- Ensured that querysets on models with callable defaults can be pickled. No, really this time. Thanks to Alex for his help brainstorming the solution.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-21 16:34:33 +00:00
Russell Keith-Magee 4f98a7c45f Fixed #12850 -- Ensured that constraint names are quoted when they are removed. Thanks to Tim Kersten for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12811 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-20 12:29:17 +00:00
Russell Keith-Magee b3e1162ca5 Fixed #12633 -- Modified some old m2m attribute use in deprecated m2m table creation methods. Also added PendingDeprecation warnings to those methods. Thanks to Alex for the suggestion, and Ramiro for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12262 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-19 01:25:30 +00:00
Russell Keith-Magee ff60c5f9de Fixed #1142 -- Added multiple database support.
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project.
Congratulations to Alex for a job well done.

Big thanks also go to:
 * Justin Bronn for keeping GIS in line with the changes,
 * Karen Tracey and Jani Tiainen for their help testing Oracle support
 * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback.
 * Malcolm Treddinick for his guidance during the GSoC submission process.
 * Simon Willison for driving the original design process
 * Cal Henderson for complaining about ponies he wanted.

... and everyone else too numerous to mention that helped to bring this feature into fruition.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22 15:18:51 +00:00
Russell Keith-Magee 3412860f89 Fixed #11428 -- Ensured that SQL generating commands and dumpdata don't include proxy models in their output. Thanks to Anssi Kaariainen for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11343 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-27 14:32:30 +00:00
Gary Wilson Jr c98a46c2be Fixed #11316 -- Fixed a Python 2.3 compatibilty issue with [10966] (in Python 2.3 on 32-bit machines, 1<<32 is 0). Thanks to kylef for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11004 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-14 23:03:01 +00:00
Russell Keith-Magee 64be8f29d5 Fixed #9253 -- Modified the method used to generate constraint names so that it is consistent regardless of machine word size.
NOTE: This change is backwards incompatible for some users.

If you are using a 32-bit platform, you will observe no differences as a
result of this change. However, users on 64-bit platforms may experience
some problems using the `reset` management command.

Prior to this change, 64-bit platforms would generate a 64-bit, 16 character
digest in the constraint name; for example:

ALTER TABLE `myapp_sometable` ADD CONSTRAINT `object_id_refs_id_5e8f10c132091d1e` FOREIGN KEY ...

Following this change, all platforms, regardless of word size, will
generate a 32-bit, 8 character digest in the constraint name; for example:

ALTER TABLE `myapp_sometable` ADD CONSTRAINT `object_id_refs_id_32091d1e` FOREIGN KEY ...

As a result of this change, you will not be able to use the `reset`
management command on any table created with 64-bit constraints. This
is because the the new generated name will not match the historically
generated name; as a result, the SQL constructed by the `reset` command
will be invalid.

If you need to reset an application that was created with 64-bit
constraints, you will need to manually drop the old constraint prior
to invoking `reset`.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10966 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-06-09 12:59:41 +00:00