Fix file naming when uploading tree photos through the API

The previous version of the add tree photo API assumed the image was a PNG and
saved the file with a .png extension. This update uses the Content-Type header
to set the file extension.
Merge pull request #28 from jwalgran/topic/tree-photo-api-ext

Fix file naming when uploading tree photos through the API
Merge pull request #30 from ahinz/v1.3

Update data model with new fields
Inject i18n support for eco benefit values

Add a new param to the tm object:
    ``benefitUnitTransformer: function(k,v)''
This function returns ``v'' untouched by default but allows
a skin (in map.js) to update the and transform the values

Additional US->UK conversions were added as tags:
gal2litres
lbs2kgs

Note that $->£ is done via the database (conversion factors
are in £)
Merge pull request #31 from ahinz/topic/unit

Inject i18n support for eco benefit values
Add pests to the add form
Merge pull request #32 from ahinz/topic/forms

Add pests to the add form
Add some more advanced filters

Added the following advanced filters:

- Pests
The pests filter expects a bunch of GET params formatted like
"pests_N" where N is an index into the CHOICE param for pests

- Canopy Condition
This filter supports the following keys:
"missing_canopy_condition" which will flag trees missing the
a specific canopy condition

"canopy_N" where N is an index into the CHOICE param for canopy
conditions
Re-add search view script (delete in d3332e7816)

This script is required for geoserver to search for things properly.

In an ideal world you wouldn't need this script at all.
See issue #34 on github.
Merge pull request #35 from ahinz/topic/search

Re-add search view script (delete in d3332e7816)
Merge pull request #33 from ahinz/topic/morefilters

Add some more advanced filters
Refactor stewardship for better performance

This commit also does some general cleanup around stewardship
searching.

Previously the main stewardship search code did something like:
s <- DB(SELECT DISTINCT tree_id FROM treemap_treesteward)
for a <- actions:
  s <- DB(SELECT tree_id FROM treemap_treesteward WHERE
          tree_id IN ( ... s ....) AND action = a)

Not only does this require len(a) database queries, if the
number of stewardship entries is largish the "IN ( ... )"
clauses will fall apart.

A better way is to embed a query into the model (models.py#1218)
that does a proper group by / having and returns only the
data we need
Remove old files

Choices.sql was previously used to load data-dependent choice
values into the database (i.e. "condition codes", "powerline
options").

Since the previous structure was a bit brittle, we've updated
to using a python module (choices.py) to specify the choices
instead.

README.txt was removed because it has been superseded by
README.md
Merge pull request #36 from ahinz/topic/cleanup

Remove old files
Refactor searching

Previously the secret _build_tree_search_result was a 600+
line method of very dense and sort of crazy python

The new approach offloads most of the searching code into
search.py

search.py is essentially a set of "apply_X_filter(req,searchObj)"
methods.

When apply_filters(...) is called, it iterates through each filter
and applies it in order.

There are still future things that need to be done:
* It sucks that we have to repeat ourselves with the plot__/tree__
  stuff everywhere

* Each "apply_X_filter" method should probably have its own test
  (note that most are already covered by the search integration
   tests)

* Stewardship stuff still scares me a bit

* The "append" methods called on tile_query should instead
  create new arrays. This would gives us true referential
  transparency
Merge pull request #37 from ahinz/topic/search-refactor

Refactor searching (and bring stewardship along for the ride)

This pull request is NOT related to FB25140 (advanced search error) but it seems better to fix the problem with this new framework
Fix syntax error