August 2018
Intermediate to advanced
332 pages
9h 12m
English
Here is how these objects are going to be used in the application. Notice how this depends on the previous packages (web and storage), but not the other way round:
from storage import DBClient, DeliveryStatusQuery, OrderNotFoundErrorfrom web import NotFound, View, app, register_routeclass DeliveryView(View): async def _get(self, request, delivery_id: int): dsq = DeliveryStatusQuery(int(delivery_id), await DBClient()) try result = await dsq.get() except OrderNotFoundError as e: raise NotFound(str(e)) from e return result.message()register_route(DeliveryView, "/status/<delivery_id:int>")
In the previous section, the domain objects were shown and here the code for the application is displayed. Aren't we missing something? ...