Regression test and patch for ticket #20924.
Update LazyObject method proxy declarations to simpler form.
Merge pull request #1479 from nickbruun/ticket_20924

Proxy __len__ and __contains__ for LazyObject
Some code simplification
Made Model.__eq__ consider proxy models equivalent

Fixed #11892, fixed #16458, fixed #14492.
Fixed #20777 -- Admin proxy model deletion regression

Added proxy_models tests by Harm Geerts <github@geertswei.nl>.
Fixed #12567 -- Incorrect SQL in model inheritance case

An isnull lookup produced incorrect SQL. This was already fixed
earlier, so only tests added.
PEP 8 cleanup
Fixed #12886 -- aggregation over sliced queryset
Fixed #11881 -- removed junk from aggregation subqueries

There were clauses that weren't needed in the subqueries. These were
ORDER BY, SELECT FOR UPDATE and related selections.
Fixed #12807 -- EmptyResultSet ORed condition

The EmptyResultSet wasn't treated correctly so the end results was
incorrect, too. The bug had been already fixed in master so only tests
added.
Removed versionadded/changed annotations for 1.5
Fixed GIS regression caused by force_subq

Caused by commit 7737305a4f5dc5006d92dac3a61523ad6c2a523a
Fixed #20640 -- Avoided NoReverseMatch in get_deleted_objects

The default delete action resulted in a NoReverseMatch if it were to
list any Model with a ModelAdmin with `get_urls` overridden to remove
the change url.  Catching the error and not displaying the link in that
case, as was already done for models with no registered admins.

Thanks Keryn Knight for the report.
Correctly format missing Pillow/PIL exceptions messages. refs #19934
Avoid importing the deprecated `django.utils.importlib` package.
Fixed an aggregation test failure on MySQL.
Fixed #20943 -- Weakly reference senders when caching their associated receivers
Fixed #14043 -- Made sure nullable o2o delete works as expected

There was an old complaint about nullable one-to-one field cascading
even when the o2o field was saved to None value before the deletion.
Added an test to verify this doesn't happen.

Also some PEP 8 cleanup.
Fixed #14056 -- Made sure LEFT JOIN aren't trimmed in ORDER BY

If LEFT JOINs are required for correct results, then trimming the join
can lead to incorrect results. Consider case:

TBL A: ID | TBL B: ID  A_ID
       1           1   1
       2
Now A.order_by('b__a') did use a join to B, and B's a_id column. This
was seen to contain the same value as A's id, and so the join was
trimmed. But this wasn't correct as the join is LEFT JOIN, and for row
A.id = 2 the B.a_id column is NULL.