Opened 11 years ago

Last modified 10 years ago

#5152 enhancement new

A new and improved IResource

Reported by: lvh Owned by: Itamar Turner-Trauring
Priority: normal Milestone:
Component: web Keywords:
Cc: jknight, Itamar Turner-Trauring Branch:
Author: lvh

Description (last modified by Jean-Paul Calderone)

There are a number of problems with IResource. A (possibly non-exhaustive) list:

  1. #3711 (returning deferreds from render methods)
  2. #3621 (returning deferreds from getChild and friends)
  3. #288 (accessing uploaded data while in progress)

None of these problems can be fixed without breaking IResource, which is something we don't want to do. As a result, we need a new IResource interface.

The goal of this ticket is to produce that interface, and to introduce fixes for each individual ticket into an integration branch related to this interface. That way, once all the tickets have been addressed, we can just merge this into trunk.

Change History (8)

comment:1 Changed 11 years ago by DefaultCC Plugin

Cc: jknight added

comment:2 Changed 11 years ago by Jean-Paul Calderone

Description: modified (diff)

comment:3 Changed 11 years ago by lvh

exarkun has noted that we should probably have something like Nevow's locateChild rather than IResource's getChild.

comment:4 Changed 11 years ago by Itamar Turner-Trauring

Cc: Itamar Turner-Trauring added

If we have a new resource implementation with locateChild, ala Nevow or web2, we can require that locateChild implementations not depend on the body of request. That means we can add support for streaming uploads (#288) in a separate branch, thus allowing more incremental development.

comment:5 Changed 11 years ago by Itamar Turner-Trauring

Although I guess you wouldn't want to have it using the old API for looking at bodies, so maybe it does need to be one fell swoop.

comment:6 Changed 11 years ago by Itamar Turner-Trauring

Here is a proposed series of steps, each of which can be reviewed separately:

  1. New resource model with locateChild, and render ala web2. In particular, return a Response object from render that has response code, headers, and body producer. Actual design details may differ. The new resource would be default for twisted.web, and old resources would have backwards compatibility layer.
  1. Add support for streaming request bodies, e.g. for POST.
  1. Method dispatching in render (to render_GET, render_HEAD, etc.).
  1. Add support for POSTed forms, including file uploads.
  1. Update documentation.

comment:7 Changed 10 years ago by Itamar Turner-Trauring

Owner: set to Itamar Turner-Trauring

I need to write up this plan in much more detail on a wiki page.

comment:8 Changed 10 years ago by Itamar Turner-Trauring

Note: See TracTickets for help on using tickets.