Calling from the application

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? ...

Get Clean Code in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.