Use 'q' as the search param
Whitespace cleanups introduced in 2638112d
Reorganize views to avoid untestable functions

Standard django view practice recommends decorators and
'render_to_response' similar to:

@etag(hasher)
@json_api
def create_some_object(request):
   ....
   return render_to_response('template', {...}, RequestContext(...))

This, however, makes it very hard to test view methods in safe and
reliable way. This commit adjusts the standard paradigm to separate the
view from the code that generates the backing data.

The general transformation is to apply decorators directly and rename
the view (continuing example from above):

create_some_object_view = etag(hasher)(json_api(create_some_object))

This solves the problem of decoupling decorators but doesn't really help
with the main template problem. To do that a new 'decorator' has been
added that allows developers to wrap a function and automatically render
a template:

plot_detail_view = instance_request(etag(_plot_hash)(
    render_template('treemap/plot_detail.html', plot_detail)))

The `plot_detail` function now only needs to return `{'plot': the_plot}`
Merge pull request #60 from ahinz/fix/rename-filter

Use 'q' as the search param
Add filterable OTM tile layer

I encapsulated the manipulation of the tile layer URL in a custom subclass
of OpenLayers.Layer.XYZ so that the application can call a simple setFilter
method on the layer when the user changes filter arguments.
Merge pull request #62 from ahinz/topic/reorg-views

Reorganize views to avoid untestable functions
Add support for dict values to min/max

Refactor search to be a little cleaner, use a dict of predicate_types
to determine logic instead of if statements.
Merge pull request #63 from steventlamb/topic/refactor_search

Add support for dict values to min/max
Fix instance request helper

Include the instance as both a request property and as an view function
argument for flexibility and to keep "template only" requests simple.
Merge pull request #61 from jwalgran/topic/filter-map

Add filterable OTM tile layer
Merge pull request #65 from jwalgran/topic/fix-instance-request-helper

Fix instance request helper
Fix whitespace flakes
Merge pull request #64 from maurizi/master

Add trees to Admin interface and fix editing models
Run search when enter is pressed in a text field

I kept changing the filer value and hitting enter, expecting the page to
update.
Initial stab at making search performance acceptable

The main performance bottleneck was tree selection. This was solved
using an IN query:

```
trees = Tree.objects.filter(plot_id__in=plots)
```

This isn't really great, however, because this sort of join should
happen via a, uh, join. That said, this gives up the performance we need
to start working on search.

The other main performance helper was to only select trees that are
 useful for benefit calculations (have a species and a diameter).
Merge pull request #67 from jwalgran/topic/run-search-on-enter-key

Run search when enter is pressed in a text field
Add in boundary layer
Update geom column to 'the_geom_webmercator' for windshaft integration
Merge pull request #69 from ahinz/topic/boundary-layer

Topic/boundary layer
Merge pull request #68 from ahinz/fix/search-performance

Initial stab at making search performance acceptable