@@ -15,9 +15,7 @@ For example, the `catch()` method of an **exception handlers** is called with an
1515``` python
1616# project_name/apps/custom_exceptions.py
1717import typing as t
18- from ellar.core.exceptions import IExceptionHandler
19- from ellar.core.context import IHostContext
20- from starlette.responses import Response
18+ from ellar.common import IExceptionHandler, IHostContext, Response
2119
2220class MyCustomException (Exception ):
2321 pass
@@ -147,7 +145,8 @@ that will handler the current request.
147145
148146``` python
149147import typing
150- from ellar.core import HostContext, ControllerBase
148+ from ellar.common import ControllerBase
149+ from ellar.core import HostContext
151150
152151
153152class ExecutionContext (HostContext ):
@@ -196,8 +195,7 @@ We can then access this metadata from within our class to make certain decisions
196195``` python
197196# project_name/apps/cars/controllers.py
198197
199- from ellar.common import Body, Controller, post, set_metadata
200- from ellar.core import ControllerBase
198+ from ellar.common import Body, Controller, post, set_metadata, ControllerBase
201199from .schemas import CreateCarSerializer
202200
203201
@@ -218,8 +216,7 @@ Instead, create your own decorators, as shown below:
218216``` python
219217# project_name/apps/cars/controllers.py
220218import typing
221- from ellar.common import Body, Controller, post, set_metadata
222- from ellar.core import ControllerBase
219+ from ellar.common import Body, Controller, post, set_metadata, ControllerBase
223220from .schemas import CreateCarSerializer
224221
225222
@@ -246,8 +243,8 @@ To access the route's role(s) (custom metadata), we'll use the `Reflector` helpe
246243``` python
247244# project_name/apps/cars/guards.py
248245from ellar.di import injectable
249- from ellar.core import GuardCanActivate, IExecutionContext
250- from ellar.services import Reflector
246+ from ellar.common import GuardCanActivate, IExecutionContext
247+ from ellar.core. services import Reflector
251248
252249
253250@injectable ()
@@ -269,8 +266,7 @@ Next, we apply the `RoleGuard` to `CarController`
269266``` python
270267# project_name/apps/cars/controllers.py
271268import typing
272- from ellar.common import Body, Controller, post, set_metadata, Guards
273- from ellar.core import ControllerBase
269+ from ellar.common import Body, Controller, post, set_metadata, Guards, ControllerBase
274270from .schemas import CreateCarSerializer
275271from .guards import RoleGuard
276272
0 commit comments