alphagov/maslow — pull request #97 by fatbusinessman (2014-03-19 10:07:31+00:00)
Title: Convert needs from the API to the Need model

This gives us access to the model methods from the list view, and generally reduces the effort required to reason about what we're dealing with in the view code, rather than worrying about whether something is a need object or something that happens to look like it.

This was particularly dangerous, since the OpenStruct-based responses from the API adapter silently return `nil` when asked for something they don't understand, so templates will silently behave incorrectly.

There is some complication here, as the view uses the need list to set up pagination controls, so it has to retain the pagination fields along with the list of needs. This might be worth factoring apart.