Adding more extension tests to Djblets

Just added a few tests for the ExtensionManager and the Hooks.

A lot of the ExtensionManager methods aren't tested yet.  Things like the
Manager calling syncdb are making things kind of difficult.

Reviewed at http://reviews.reviewboard.org/r/1725/
Added a custom template filter called startswith.

The startswith filter was being used in the code, but didn't exist anywhere, so
I created it in djblets_utils.py.
Add a @root_url decorator for use with get_absolute_url implementations.

Since we have to hack around @permalink when using captured parameters with
reverse lookups, we need a nice way of adding the SITE_ROOT to any returned
URLs.
Update the custom fields for Django's multiple database support.

The custom fields we provide would throw warnings on the latest builds
of Django, due to not being updated for Django 1.2's multiple database
support. We now take in the required parameters in such a way where it
should remain compatible with Django 1.1.
Merge branch 'master' into extensions
Add a CounterField for atomically updating counters.

This provides a new CounterField, which can be used for atomically
incrementing or decrementing an integer. It's intended for use as
a substitute to potentially expensive or numerous SQL queries to retrieve
counts of objects.

CounterField can take an optional initializer function to populate the
field the first time it's ever accessed (such as after creation or
database evolution). After that, the value will be treated as an integer.

CounterField can update an individual instance's field, or can batch-update
the field on several objects at once.

Reviewed at http://reviews.reviewboard.org/r/1835/
Use MEDIA_SERIAL for images in datagrids.
Add Ben Hollis to AUTHORS
Use select_related to reduce SQL queries in resource API methods

This change uses select_related
(http://docs.djangoproject.com/en/dev/ref/models/querysets/#select-related) to
reduce the number of queries needed to serve resources. Select_related will use
joins to include one-to-one relations in the initial query, meaning you won't
have to do another query to fetch them after the main object is retrieved.
Since the API methods always return the completely expanded object, this can
end up being a significant savings in queries with no real downside since there
aren't situations where those records wouldn't have been retrieved anyway.

Reviewed at http://reviews.reviewboard.org/r/1894/
Fix CounterField for new models.

Any new model with a CounterField was being saved immediately upon creation,
which would cause lots of problems, particularly when adding a new object in
the Admin UI.

Now, new objects are initialized to 0. They don't use the initializer
(since the initializer will likely access fields on the model that can't
yet be accessed). We may want to extend this longer-term to use better
defaults or to try an initializer and fall back on 0.

This also gets rid of the CounterProxy class, which shouldn't have slipped in.
Update Djblets Extensions to work with django_evolution's new support
for multiple databases.

Added Hongbin Lu to AUTHORS.

Reviewed at http://reviews.reviewboard.org/r/1906/
Add a serialize_object_func to the get_list paginated response

By default get_list was just using the objects' own serialize func, which worked
for our current uses, but wouldn't get passed the args and kwargs from the
initial request URL parse. Adding a serialize_object_func to this call will fix
this, and also lets us remove the special override in ReviewBoard's
DraftScreenshotResource.
Pass args and kwargs through get_related_links.

The basic get_related_links function inside WebAPIResource was calling children
without passing in args and kwargs, which meant that any optional parameters
passed through those would get eaten.
Fix serialize_object lamba.

Instead of serializing using the parent's class, we want the child to do it.
Release Djblets 0.6.5.
Merge branch 'master' into extensions
Bump to 0.6.6.
Bump to 0.6.6.
Fix a regression with Django 1.1 in JSONField.

JSONField was attempting to unconditionally pass a connection to the parent
function in get_db_prep_save. It was also unconditionally passing a None
connection, meaning we weren't even getting benefits under Django 1.2. We
now just pass any extra arguments we may be getting directly down, fixing
compatibility with Django 1.1 and 1.2.
Release Djblets 0.6.6.