Don't fail in checkuserorperm if the user is anonymous.

The checkuserorperm template tag was breaking if the user was anonymous.
This wasn't always obvious in templates, but it was obvious in unit
tests.
Reduce queries on datagrids by pre-populating a cache of fetched objects.

Many columns on the datagrid render related objects, such as a user. We
had a cache in place that would prevent duplicate lookups of objects
with the same ID, but we'd still do one query per unique ID.

Now we allow columns to collect the data before rendering, based on the
objects being displayed. By default, this will loop through the objects,
build a list of all IDs that will be displayed, and then populate the
existing cache with those fetched objects. This reduces the query count
to at max one per column for all cases using ForeignKeys.

ManyToManyFields is another matter entirely, and will take more
specialized work.
Release Djblets 0.6.20.
Bump to 0.6.21 dev.
Merge branch 'release-0.6.x'
Fix a bug with databases using longs for IDs.

Our new optimizations for ifuserorperm assumed IDs were ints. This
caused them to fail for databases where it was some other type.

Now we reverse the check and just make sure it's a User before doing a
direct compare, or otherwise we compare against the ID.
Release Djblets 0.6.21.
Merge branch 'release-0.6.x'
Lazily import User and AnonymousUser in djblets_utils.

rbssh in Review Board makes use of humanize_list in djblets_utils, but
the recent introduction of the User and AnonymousUser imports broke it,
as it then required Django settings to be set up.

This moves the import into the one function that needs it, in order to
prevent this kind of problem.

Fixes bug #2686
Release Djblets 0.6.22.
Merge branch 'release-0.6.x'
Bump the minimum version of Django to 1.4.1.

1.4.1 was just released, which fixes some security issues. Require it as
a minimum version.
Fix link generation for extension web API resources

This change adds the Web API resources defined in an extension's
`resources` attribute to the link tree. Now each resource will be added
to the 'links' dictionary of the extension resource, and in the list of
extensions. These links will only appear when the extension is enabled.

Also fixed is improper generation of the resource URLs. The URLs were
generated with the wrong attribute, causing them to use underscores
instead of dashes.

Reviewed at http://reviews.reviewboard.org/r/3082/
Move humanize_list into djblets.util.humanize.

The humanize_list function has been causing some problems. It's useful
outside of template tags and outside of a Django setting environment,
but things are being imported in the djblets_utils.py template tag file
that end up requiring a proper Django environment.

This now lives in djblets.util.humanize. It's still available as a
template tag, though.
Merge branch 'release-0.6.x'
Bump to 0.6.23.dev.
Conditionalize ez_setup

This makes life simpler for packagers, since most packaging tools
will ensure that the appropriate packages are available on the
system. Additionally, most packaging tools prefer not to rely on
network access (since it can mean that identical rebuilds cannot
be performed).

Built locally with 'python setup.py build' and also by applying this patch and
performing an RPM build in a network-free environment.

This is essentially the same patch as
http://reviews.reviewboard.org/r/3186/ (which was for Review Board
itself)

Reviewed at http://reviews.reviewboard.org/r/3252/
Remove an unused import.

This was reported by pyflakes.
Merge branch 'release-0.6.x'
Release Djblets 0.7.0.