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
|
@ -28,9 +28,12 @@ from __future__ import unicode_literals, absolute_import
|
|||
|
||||
from rattail.db import model
|
||||
|
||||
from cornice.resource import resource
|
||||
|
||||
from tailbone.api import APIMasterView
|
||||
|
||||
|
||||
@resource(collection_path='/api/customers', path='/api/customer/{uuid}')
|
||||
class CustomerView(APIMasterView):
|
||||
|
||||
model_class = model.Customer
|
||||
|
@ -43,4 +46,4 @@ class CustomerView(APIMasterView):
|
|||
|
||||
|
||||
def includeme(config):
|
||||
CustomerView.defaults(config)
|
||||
config.scan(__name__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue