mozilla-services/cornice — pull request #131 by tomster (2013-03-12 09:40:15+00:00)
Title: context factory support

cornice 'abuses' the `factory` predicate to support ACLs. however, in our own use case we expected `factory` to provide a context for views, as is customary in pyramid.

this patch attempts a backward compatible approach. since the cornice docs state that the `args` and `factory` predicates require each other, we simply check like so:

```python
if 'factory' in args and 'acl' not in args:
```

and then call the view with the result of the factory call and pass it in as `context`.

is this compromise acceptable? in the long run we'd argue that cornice should use a custom predicate such as `acl_factory` and leave the `factory` keyword for its 'officially' intended use, but that's perhaps a different issue.

if you agree, we're perfectly willing to add the required tests and update the documentation accordingly. at the moment this PR is just a probe to test the waters :-)