cellcounter/cellcounter — pull request #240 by jvc26 (2014-03-21 14:04:57+00:00)
Title: Cc kapi default behaviour

This rewrites most of the CC_KAPI backend to properly support RESTful interfaces. The following URL/behaviours have been implemented:

GET /api/keyboards/	-> Lists all user keyboards, [] if anonymous
POST /api/keyboards/	-> Creates a new user keyboard
GET /api/keyboards/default/	-> Gets user primary keyboard
GET /api/keyboards/{id}/	-> Gets specified keyboard
PUT /api/keyboards/{id}/	-> Updates specified keyboard
DELETE /api/keyboards/{id}/	-> Deletes specified keyboard

Back end changes:
* Added simple ```DefaultKeyboardView``` to handle default keyboards, with own endpoints in URLs
* Added ```KeyboardsListCreateView``` to provide a List interface when visiting /keyboards/ which will make for easy front-end development of user-keyboard-switching
* Renamed ```KeyboardView``` to ```KeyboardGetUpdateDestroyView``` to better describe function. This now handles the whole keyboard-detail handling.
* ```KeyboardGetUpdateDestroyView``` no longer tolerates anonymous users, returning correct 403, rather than a DEFAULT_KEYBOARD instance. This is much more in keeping with code intention
* ```KeyboardGetUpdateDestroyView``` no longer masks POSTed requests with existing keyboards as an update request, instead raising a 405 not implemented.

Front end changes:
* Now correctly obtains keyboards from the /api/keyboards/ or /api/keyboards/default/ endpoint, unless otherwise specified

Tests have been implemented and pass for all functionality.