# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division

from django.contrib.gis.db import models
from django.utils.translation import ugettext_lazy as _

from treemap.decorators import classproperty
from treemap.models import MapFeature, GeoHStoreUDFManager
from treemap.ecobenefits import CountOnlyBenefitCalculator


class PolygonalMapFeature(MapFeature):
    area_field_name = 'polygon'
    skip_detail_form = True

    polygon = models.MultiPolygonField(srid=3857)

    objects = GeoHStoreUDFManager()

    @property
    def is_editable(self):
        # this is a holdover until we can support editing for all resources
        return True

    @classproperty
    def benefits(cls):
        return CountOnlyBenefitCalculator(cls)


class Bioswale(PolygonalMapFeature):
    objects = GeoHStoreUDFManager()

    collection_udf_settings = {
        'Stewardship': {
            'range_field_key': 'Date',
            'action_field_key': 'Action',
            'action_verb': 'that have been',
            'defaults': [
                {'name': 'Action',
                 'choices': ['Watered',
                             'Pruned',
                             'Mulched, Had Compost Added, or Soil Amended',
                             'Cleared of Trash or Debris'],
                 'type': 'choice'},
                {'type': 'date',
                 'name': 'Date'}],
        }
    }

    @classproperty
    def search_display_name(cls):
        return _('bioswales')

@@ -1159,27 +1159,86 @@
 ': %5B
-'Watered',%0A        
+%0A                     'Removed litter',%0A                     'Removed weeds',%0A
     
@@ -1261,16 +1261,23 @@
  'Pruned
+ plants
 ',%0A     
@@ -1296,120 +1296,249 @@
     
-        'Mulched, Had Compost Added, or Soil Amended',%0A                             'Cleared of Trash or Debris'
+'Pruned trees',%0A                     'Watered bioswale',%0A                     'Removed sediments',%0A                     'Redistributed gravel',%0A                     'Redistributed soil',%0A                     'Aerated soil',%0A                 
 %5D,%0A 

Update bioswale stewardship default choices