Ecotrust / wc-marine-debris

West Coast Governor's Alliance marine debris database
2 stars 1 forks source link

Download functionality #101

Closed perrygeo closed 11 years ago

perrygeo commented 11 years ago

This branch contains three new features that we should look at merging:

  1. Download csv datasets by passing a filter json. All data field plus special fields related to projects, organizations, events, sites, etc are included as columns

    /events/download.csv?filter=[{%22type%22:%22event_type%22,%22value%22:%22Site%20Cleanup%22}]
  2. Unit conversion. There is now a UnitConversion table to define multiplier factors when converting between units. The details of how and when to use it are abstracted into the FieldValue model as a @converted_value property ensuring that you can always call field_value.converted_value and get the right answer
  3. Caching cleanup. Started the process of moving event-specific caches into the Event model and it's properties/methods. Makes views cleaner. The cache keys are normalized to event_<event_id>_blahcache which will eventually allow for wildcard invalidation.