From 99a22b40eb08eb14f5cfe387d05cdc40e5aa1e25 Mon Sep 17 00:00:00 2001 From: tomchristie Date: Fri, 6 Jan 2012 03:41:49 -0800 Subject: [PATCH] Updated Stuff that needs to change (markdown) --- Draft-1.0-documentation.md | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/Draft-1.0-documentation.md b/Draft-1.0-documentation.md index 115400a..2cb56c0 100644 --- a/Draft-1.0-documentation.md +++ b/Draft-1.0-documentation.md @@ -2,26 +2,26 @@ Stuff that needs to change ========================== 1. Drop short status codes. -2. Response to inherit from HttpResponse. - + Becomes a type of standard Django Template Response, with .render() method. - + add_header() dropped from View - set headers on the response as with standard Django. -3. Request to extend from HttpRequest. - + self.DATA, self.FILES, self.auth, self.method will become request.DATA, request.FILES, request.method... -4. Resource.filter_response, Resource.validate_request -> Serializer.serialize, Deserializer.deserialize - + Serializer, Deserializer will be decoupled from Resource. - + Method names changed to serialize, deserializer - conceptually more obvious. +2. Response to inherit from `HttpResponse`. + + Becomes a type of standard Django Template Response, with `.render()` method. + + `add_header()` dropped from `View` - set headers on the response as with standard Django. +3. Request to extend from `HttpRequest`. + + `self.DATA`, `self.FILES`, `self.auth`, `self.method` will become `request.DATA`, `request.FILES`, `request.method`... +4. `Resource.filter_response`, `Resource.validate_request` -> `Serializer.serialize`, `Deserializer.deserialize` + + `Serializer`, `Deserializer` will be decoupled from `Resource`. + + Method names changed to `serialize`, `deserializer` - conceptually more obvious. + Views will have `.serializer`, `.deserializer` -5. View and Resource concepts separated. +5. `View` and `Resource` concepts separated. + Views handle request and response objects, provide `.get()`, `.post()`, `.put()`... + Resources handle instances and filter arguments, provide `.read()`, `.create()`, `.list()`... + Views can no longer return raw objects, must return responses. + Views no longer have optional `model`, `form` properties that automagically create resources, if they use a resource, it must be provided using `.resource` -6. Drop set_script_prefix munging. +6. Drop `set_script_prefix` munging. + Provide a `reverse` call that extends the standard `reverse`, but can take the current request as an argument if an absolute URL is required. -7. Hooks throughout for creating .resource, .serializer, .renderer etc... instances inside the View, given the classes. -8. InstanceMixin needs to disappear. +7. Hooks throughout for creating `.resource`, `.serializer`, `.renderer` etc... instances inside the View, given the classes. +8. `InstanceMixin` needs to disappear. Stuff that might not be quite perfect, but will do for now ========================================================== @@ -40,6 +40,16 @@ Stuff that's not quite figured out What needs to be done ===================== -1. Get cracking on 1.0 documentation. +1. Get cracking on 1.0 documentation. (Can start on docs, before code is complete) + + Introduction, Getting started. + + API guide. + * Views. + * Requests & Responses. + * Renderers & Parsers. + * Authentication & Permissions. + * Serializing & Deserializing. + * Resources. + + Examples. (Use existing examples.) + + Contributing and other topics. 2. Gradually migrate codebase towards 1.0, in way that causes minimal disruption. 3. Triage and clean up existing tickets. \ No newline at end of file