Falcon v0.2.0 Documentationclass CatalogItem(object): # ... @falcon.before(hooks.to_oid) def on_get(self, id): return self._collection.find_one(id) app = falcon.API(after=[hooks.serialize]) app.add_route('/items/{id}', CatalogItem()) taking into account the user’s role and the requested resource. Tip: The Talons project maintains a collection of auth plugins for the Falcon framework. Why doesn’t Falcon create a new Resource instance for items for the same resource? Suppose you wanted to implement the following endpoints: # Resource Collection POST /resources GET /resources{?marker, limit} # Resource Item GET /resources/{id} PATCH /resources/{id}0 码力 | 70 页 | 296.15 KB | 1 年前3
Falcon v0.3.0.1 Documentationclass CatalogItem(object): # ... @falcon.before(hooks.to_oid) def on_get(self, id): return self._collection.find_one(id) app = falcon.API(after=[hooks.serialize]) app.add_route('/items/{id}', CatalogItem()) taking into account the user’s role and the requested resource. Tip: The Talons project maintains a collection of auth plugins for the Falcon framework. Why doesn’t Falcon create a new Resource instance for items for the same resource? Suppose you wanted to implement the following endpoints: # Resource Collection POST /resources GET /resources{?marker, limit} # Resource Item GET /resources/{id} PATCH /resources/{id}0 码力 | 77 页 | 311.34 KB | 1 年前3
Falcon v0.3.0.1 DocumentationCatalogItem(object): # ... @falcon.before(hooks.to_oid) def on_get(self, id): return self._collection.find_one(id) app = falcon.API(after=[hooks.serialize]) app.add_route('/items/{id}', CatalogItem()) the requested resource. Tip The Talons project [https://github.com/talons/talons] maintains a collection of auth plugins for the Falcon framework. Why doesn’t Falcon create a new Resource instance for items for the same resource? Suppose you wanted to implement the following endpoints: # Resource Collection POST /resources GET /resources{?marker, limit} # Resource Item GET /resources/{id} PATCH /resources/{id}0 码力 | 126 页 | 345.09 KB | 1 年前3
Falcon v0.2.0 DocumentationCatalogItem(object): # ... @falcon.before(hooks.to_oid) def on_get(self, id): return self._collection.find_one(id) app = falcon.API(after=[hooks.serialize]) app.add_route('/items/{id}', CatalogItem()) the requested resource. Tip The Talons project [https://github.com/talons/talons] maintains a collection of auth plugins for the Falcon framework. Why doesn’t Falcon create a new Resource instance for items for the same resource? Suppose you wanted to implement the following endpoints: # Resource Collection POST /resources GET /resources{?marker, limit} # Resource Item GET /resources/{id} PATCH /resources/{id}0 码力 | 188 页 | 358.44 KB | 1 年前3
Falcon v1.0.0 Documentationclass CatalogItem(object): # ... @falcon.before(hooks.to_oid) def on_get(self, id): return self._collection.find_one(id) app = falcon.API(after=[hooks.serialize]) app.add_route('/items/{id}', CatalogItem()) items for the same resource? Suppose you wanted to implement the following endpoints: # Resource Collection POST /resources GET /resources{?marker, limit} # Resource Item GET /resources/{id} PATCH /resources/{id} represent the collection of said resources. It is common to place both classes in the same module. The Falcon community did some experimenting with routing both singleton and collection-based operations0 码力 | 87 页 | 348.15 KB | 1 年前3
Falcon v3.1.1-b3 Documentationuseful when creating a POST endpoint in the application that can add new image resources to our collection. We’ll tackle this functionality next. We’ll use TDD this time around, to demonstrate how to apply import io import os import re import uuid import mimetypes import falcon import msgpack class Collection: def __init__(self, image_store): self._image_store = image_store def on_get(self, req, resp): 5. Documentation Falcon Documentation, Release 3.1.1b3 As you can see, we renamed Resource to Collection and added a new Item class to represent a single image resource. Alternatively, these two classes0 码力 | 378 页 | 1.29 MB | 1 年前3
Falcon v3.1.1-b1 Documentationuseful when creating a POST endpoint in the application that can add new image resources to our collection. We’ll tackle this functionality next. We’ll use TDD this time around, to demonstrate how to apply import io import os import re import uuid import mimetypes import falcon import msgpack class Collection: def __init__(self, image_store): self._image_store = image_store def on_get(self, req, resp): 5. Documentation Falcon Documentation, Release 3.1.1b1 As you can see, we renamed Resource to Collection and added a new Item class to represent a single image resource. Alternatively, these two classes0 码力 | 378 页 | 1.29 MB | 1 年前3
Falcon v3.1.1-a Documentationuseful when creating a POST endpoint in the application that can add new image resources to our collection. We’ll tackle this functionality next. We’ll use TDD this time around, to demonstrate how to apply import io import os import re import uuid import mimetypes import falcon import msgpack class Collection: def __init__(self, image_store): self._image_store = image_store def on_get(self, req, resp): Chapter 5. Documentation Falcon Documentation, Release 3.1.1 As you can see, we renamed Resource to Collection and added a new Item class to represent a single image resource. Alternatively, these two classes0 码力 | 378 页 | 1.29 MB | 1 年前3
Falcon v3.1.0 Documentationuseful when creating a POST endpoint in the application that can add new image resources to our collection. We’ll tackle this functionality next. We’ll use TDD this time around, to demonstrate how to apply import io import os import re import uuid import mimetypes import falcon import msgpack class Collection: def __init__(self, image_store): self._image_store = image_store def on_get(self, req, resp): Chapter 5. Documentation Falcon Documentation, Release 3.1.0 As you can see, we renamed Resource to Collection and added a new Item class to represent a single image resource. Alternatively, these two classes0 码力 | 362 页 | 1.29 MB | 1 年前3
Falcon v3.1.1 Documentationuseful when creating a POST endpoint in the application that can add new image resources to our collection. We’ll tackle this functionality next. We’ll use TDD this time around, to demonstrate how to apply import io import os import re import uuid import mimetypes import falcon import msgpack class Collection: def __init__(self, image_store): self._image_store = image_store def on_get(self, req, resp): Chapter 5. Documentation Falcon Documentation, Release 3.1.1 As you can see, we renamed Resource to Collection and added a new Item class to represent a single image resource. Alternatively, these two classes0 码力 | 378 页 | 1.29 MB | 1 年前3
共 40 条
- 1
- 2
- 3
- 4













