django1/django
Florian Apolloner bc7dd8490b Fixed #21171 -- Avoided starting a transaction when a single (or atomic queries) are executed.
Checked the following locations:

 * Model.save(): If there are parents involved, take the safe way and use
   transactions since this should be an all or nothing operation.

   If the model has no parents:

    * Signals are executed before and after the previous existing
      transaction -- they were never been part of the transaction.

    * if `force_insert` is set then only one query is executed -> atomic
      by definition and no transaction needed.

    * same applies to `force_update`.

    * If a primary key is set and no `force_*` is set Django will try an
      UPDATE and if that returns zero rows it tries an INSERT. The first
      case is completly save (single query). In the second case a
      transaction should not produce different results since the update
      query is basically a no-op then (might miss something though).

 * QuerySet.update(): no signals issued, single query -> no transaction
   needed.

 * Model/Collector.delete(): This one is fun due to the fact that is
   does many things at once.

   Most importantly though: It does send signals as part of the
   transaction, so for maximum backwards compatibility we need to be
   conservative.

   To ensure maximum compatibility the transaction here is removed only
   if the following holds true:

     * A single instance is being deleted.
     * There are no signal handlers attached to that instance.
     * There are no deletions/updates to cascade.
     * There are no parents which also need deletion.
2018-10-17 12:19:02 +02:00
..
apps Refs #28909 -- Simplifed code using unpacking generalizations. 2018-09-28 09:57:12 -04:00
bin Reverted "Fixed #27878, refs #23919 -- Used python3 shebangs." 2017-03-07 10:10:32 -05:00
conf Fixed #29817 -- Deprecated settings.FILE_CHARSET. 2018-10-15 17:15:41 -04:00
contrib Fixed #29832 -- Updated Roboto font to v2.137. 2018-10-11 23:30:45 -04:00
core Capitalized "Python" in docs and comments. 2018-10-09 09:26:07 -04:00
db Fixed #21171 -- Avoided starting a transaction when a single (or atomic queries) are executed. 2018-10-17 12:19:02 +02:00
dispatch Capitalized "Python" in docs and comments. 2018-10-09 09:26:07 -04:00
forms Refs #29689 -- Moved FilePathField choices sorting outside the loop. 2018-08-29 06:19:32 -04:00
http Normalized spelling of "lowercase" and "lowercased". 2018-09-25 10:30:18 -04:00
middleware Fixed #29728 -- Prevented session resaving if CSRF cookie is unchanged. 2018-09-08 11:46:13 -04:00
template Refs #28909 -- Simplifed code using unpacking generalizations. 2018-09-28 09:57:12 -04:00
templatetags Replaced TOKEN_* constants by TokenType enums. 2018-05-10 17:51:51 +02:00
test Capitalized "Python" in docs and comments. 2018-10-09 09:26:07 -04:00
urls Fixed #29775 -- Fixed URL converters in a nested namespaced path. 2018-10-04 11:42:27 -04:00
utils Fixed typo in django/utils/datastructures.py. 2018-10-14 11:20:22 -04:00
views Refs #29784 -- Switched to https:// links where available. 2018-09-26 08:48:47 +02:00
__init__.py Bumped version; master is now 2.2 pre-alpha. 2018-05-17 09:37:06 -04:00
__main__.py Fixed #24857 -- Added "python -m django" entry point. 2015-09-07 19:54:32 -04:00
shortcuts.py Added missing word to render_to_response deprecation warning. 2018-05-16 10:06:36 +02:00