Use Cornice for REST API viws
still very experimental at this point
This commit is contained in:
parent
31ae5eacd5
commit
ad35481234
5 changed files with 51 additions and 52 deletions
|
@ -30,9 +30,12 @@ import six
|
|||
|
||||
from rattail.db import model
|
||||
|
||||
from cornice.resource import resource
|
||||
|
||||
from tailbone.api import APIMasterView
|
||||
|
||||
|
||||
@resource(collection_path='/api/users', path='/api/users/{uuid}')
|
||||
class UserView(APIMasterView):
|
||||
|
||||
model_class = model.User
|
||||
|
@ -45,4 +48,4 @@ class UserView(APIMasterView):
|
|||
|
||||
|
||||
def includeme(config):
|
||||
UserView.defaults(config)
|
||||
config.scan(__name__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue