equal
deleted
inserted
replaced
|
1 from __future__ import absolute_import |
|
2 |
|
3 |
|
4 from pyramid.httpexceptions import HTTPNotFound |
|
5 from pyramid.view import view_config |
|
6 from cubicweb.pyramid.resources import EntityResource, ETypeResource |
|
7 from cubicweb.pyramid.predicates import MatchIsETypePredicate |
|
8 |
|
9 |
|
10 @view_config( |
|
11 route_name='cwentities', |
|
12 context=EntityResource, |
|
13 request_method='DELETE') |
|
14 def delete_entity(context, request): |
|
15 context.rset.one().cw_delete() |
|
16 request.response.status_int = 204 |
|
17 return request.response |
|
18 |
|
19 |
|
20 def includeme(config): |
|
21 config.add_route( |
|
22 'cwentities', '/{etype}/*traverse', |
|
23 factory=ETypeResource.from_match('etype'), match_is_etype='etype') |
|
24 config.scan(__name__) |