Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/db/models/deletion.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #18012 -- Made proxy and concrete model reverse ↵Simon Charette2015-10-121-1/+1
| | | | | | | fields consistent. Prior to this change proxy models reverse fields didn't include the reverse fields pointing to their concrete model.
* Fixed #23076, #25505 -- Fixed deletion of intermediate ↵Simon Charette2015-10-121-1/+1
| | | | | | proxy models. Thanks to James Murty for his work on an alternate patch.
* Refs #18012 -- Removed special casing for proxy models ↵Simon Charette2015-10-121-10/+1
| | | | | | | deletion. This isn't required anymore now that reverse foreign keys from proxy models are propagated to their concrete model.
* Fixed #25058 -- Added GenericRelations with ↵sarthakmeh2015-09-031-5/+2
| | | | related_query_name to the admin's delete confirmation page.
* Fixed #25331 -- Removed trailing blank lines in docstrings.Maxime Lorant2015-08-311-1/+0
|
* Fixed #16891 -- Made Model/QuerySet.delete() return the ↵Alexander Sosnovskiy2015-05-221-3/+8
| | | | number of deleted objects.
* Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen2015-03-251-9/+8
| | | | | | | | Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
* Fixed typo in refs #15579 comment.Tim Graham2015-03-171-2/+1
|
* Fixed #15579 -- Added ability to delete only child ↵Andriy Sokolovskiy2015-03-171-15/+19
| | | | models in multi-table inheritance.
* Fixed #24289 -- Reversed usage of Field.many_to_one and ↵Loic Bistuer2015-02-131-1/+1
| | | | | | | one_to_many. Thanks Carl Meyer and Tim Graham for the reviews and to all involved in the discussion.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-1/+1
|
* Fixed #12663 -- Formalized the Model._meta API for ↵Daniel Pyrathon2015-01-071-6/+22
| | | | | | | retrieving fields. Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
* Replaced set([foo, ...]) by {foo, ...} literals. Refs PR ↵Thomas Chaumeny2014-09-281-3/+3
| | | | | | 3282. Thanks Collin Anderson for the review.
* Fixed #16426 -- deletion of 1000+ objects with relations ↵Anssi Kääriäinen2014-08-111-5/+19
| | | | | | | | | | | | | on SQLite SQLite doesn't work with more than 1000 parameters in a single query. The deletion code could generate queries that try to get related objects for more than 1000 objects thus breaking the limit. Django now splits the related object fetching into batches with at most 1000 parameters. The tests and patch include some work done by Trac alias NiGhTTraX in ticket #21205.
* Fixed #22998 -- Updated the fast_delete logic for GFKsGavin Wahl2014-07-161-3/+3
|
* Removed legacy transaction management per the ↵Aymeric Augustin2014-03-211-1/+1
| | | | deprecation timeline.
* Fixed many typos in comments and docstrings.Rodolfo Carvalho2014-03-031-2/+2
| | | | Thanks Piotr Kasprzyk for help with the patch.
* Fixed E125 pep8 warningsChristopher Medrela2013-11-281-2/+2
|
* Made MigrationWriter look for a "deconstruct" attribute ↵Loic Bistuer2013-09-101-0/+1
| | | | | | on functions. Refs #20978.
* Fixed #20978 -- Made deletion.SET_NULL more friendly for ↵Loic Bistuer2013-09-101-1/+2
| | | | MigrationWriter.serialize.
* Fixed #20989 -- Removed useless explicit list ↵Simon Charette2013-08-301-2/+2
| | | | comprehensions.
* Deprecated SortedDict (replaced with ↵Curtis Maloney2013-08-041-2/+2
| | | | | | collections.OrderedDict) Thanks Loic Bistuer for the review.
* Fixed #19385 again, now with real code changesAnssi Kääriäinen2013-03-241-10/+5
| | | | | The commit of 266de5f9ae9e9f2fbfaec3b7e4b5fb9941967801 included only tests, this time also code changes included...
* Used commit_on_success_unless_managed to make ORM ↵Aymeric Augustin2013-03-111-50/+32
| | | | operations atomic.
* Deprecated transaction.is_managed().Aymeric Augustin2013-03-111-1/+1
| | | | It's synchronized with the autocommit flag.
* Deprecated transaction.commit/rollback_unless_managed.Aymeric Augustin2013-03-111-2/+0
| | | | | | | | Since "unless managed" now means "if database-level autocommit", committing or rolling back doesn't have any effect. Restored transactional integrity in a few places that relied on automatically-started transactions with a transitory API.
* Made transaction.managed a no-op and deprecated it.Aymeric Augustin2013-03-111-1/+1
| | | | | | | | | | | | | | enter_transaction_management() was nearly always followed by managed(). In three places it wasn't, but they will all be refactored eventually. The "forced" keyword argument avoids introducing behavior changes until then. This is mostly backwards-compatible, except, of course, for managed itself. There's a minor difference in _enter_transaction_management: the top self.transaction_state now contains the new 'managed' state rather than the previous one. Django doesn't access self.transaction_state in _enter_transaction_management.
* Move logic seperation as its not longer repetitiveDavid Cramer2013-01-141-9/+6
|
* Send post_delete signals immediatelyDavid Cramer2013-01-141-10/+12
| | | | | | | | | In a normal relational construct, if you're listening for an event that signals a child was deleted, you dont expect that the parent was deleted already. This change ensures that post_delete signals are fired immediately after objects are deleted in the graph.
* Removed some now dead code from deletion (thanks to Carl ↵Alex Gaynor2013-01-121-14/+0
| | | | Meyer for noticing it).
* Fixed #18676 -- Allow fast-path deletion of objectsAnssi Kääriäinen2012-09-281-6/+57
| | | | | | | | | Objects can be fast-path deleted if there are no signals, and there are no further cascades. If fast-path is taken, the objects do not need to be loaded into memory before deletion. Thanks to Jeremy Dunck, Simon Charette and Alex Gaynor for reviewing the patch.
* remove a bunch of unnescesarry iterkeys() callsAlex Gaynor2012-08-081-1/+1
|
* [py3] Fixed access to dict keys/values/items.Aymeric Augustin2012-08-071-12/+13
|
* Fixed #18083 -- Fixed cascade deletion with proxy model ↵Carl Meyer2012-04-101-3/+4
| | | | | | of concrete subclass. Thanks Simon Charette for report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #17918 - Handle proxy models correctly when ↵Carl Meyer2012-03-171-3/+12
| | | | | | sorting deletions for databases without deferred constraints. Thanks Nate Bragg for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17756 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16128 - Correctly cascade-delete proxy models as ↵Carl Meyer2012-03-051-1/+3
| | | | | | if they were the concrete model class. Thanks xkennyx for the report, and Aymeric Augustin, Claude Paroz, Adam Nelson, jaap3, and Anssi Kääriäinen for work on the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17664 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16584 -- Fixed a bunch of typos in code comments. ↵Jannis Leidel2011-08-121-1/+1
| | | | | | Thanks, Bernhard Essl. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #16225 -- Removed unused imports. Many thanks to ↵Jannis Leidel2011-07-131-1/+0
| | | | | | Aymeric Augustin for the work on the patch and Alex for reviewing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15776 - delete regression in Django 1.3 involving ↵Luke Plant2011-05-301-3/+3
| | | | | | | | | nullable foreign keys Many thanks to aaron.l.madison for the detailed report and to emulbreh for the fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16295 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Removed a bunch more Python 2.4 workarounds now that we ↵Adrian Holovaty2011-03-281-3/+2
| | | | | | don't support that version. Refs #15702 -- thanks to jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed Python 2.4 incompatibility introduced in r15249.Carl Meyer2011-01-261-1/+2
| | | | git-svn-id: http://code.djangoproject.com/svn/django/trunk@15329 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #14672 - Added admin handling for ↵Carl Meyer2011-01-201-2/+17
| | | | | | on_delete=PROTECT. Thanks to jtiai for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #15118 - Corrected the deletion-ordering for ↵Carl Meyer2011-01-191-5/+13
| | | | | | inherited models. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15246 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Avoid doing quadratic amounts of work during object ↵Alex Gaynor2011-01-191-5/+6
| | | | | | deletion. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15243 bcc190cf-cafb-0310-a4f2-bffc1f526a37
* Fixed #7539, #13067 -- Added on_delete argument to ↵Carl Meyer2010-11-091-0/+245
ForeignKey to control cascade behavior. Also refactored deletion for efficiency and code clarity. Many thanks to Johannes Dollinger and Michael Glassford for extensive work on the patch, and to Alex Gaynor, Russell Keith-Magee, and Jacob Kaplan-Moss for review. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14507 bcc190cf-cafb-0310-a4f2-bffc1f526a37