You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+1-11Lines changed: 1 addition & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,7 @@ To get started, you need to scaffold a project using [Ellar-CLI](https://eadwinc
31
31
The scaffolded project is more like a guide to project setup.
32
32
33
33
```shell
34
-
$(venv) pip install ellar[standard]
35
-
```
36
-
OR
37
-
```shell
38
-
$(venv) pip install ellar ellar-cli
34
+
$(venv) pip install ellar
39
35
```
40
36
41
37
After that, lets create a new project.
@@ -44,12 +40,6 @@ Run the command below and change the `project-name` with whatever name you decid
44
40
$(venv) ellar new project-name
45
41
```
46
42
47
-
### NB:
48
-
Some shells may treat square braces (`[` and `]`) as special characters. If that's the case here, then use a quote around the characters to prevent unexpected shell expansion.
Copy file name to clipboardExpand all lines: docs/overview/custom_decorators.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -388,10 +388,10 @@ More information on how to use this decorator can be found in the [Versioning do
388
388
389
389
A quick example on how to use `version` decorator:
390
390
```python
391
-
from ellar.common import post, version
391
+
from ellar.common import post, Version
392
392
393
393
@post("/create", name='v2_v3_list')
394
-
@version('2', '3')
394
+
@Version('2', '3')
395
395
asyncdefget_item_v2_v3(self):
396
396
return {'message': 'for v2 and v3 request'}
397
397
```
@@ -401,18 +401,18 @@ This indicates that the `get_item_v2_v3` route function will handle version 2 an
401
401
This allows for multiple versions of the same endpoint to be handled by different route functions, each with their own logic and implementation.
402
402
403
403
### GUARDS
404
-
**@guards()** is a decorator that applies a protection class of type `GuardCanActivate` to a route function.
404
+
**@Guards()** is a decorator that applies a protection class of type `GuardCanActivate` to a route function.
405
405
These protection classes have a `can_execute` function that is called to determine whether a route function should be executed.
406
406
407
407
This decorator allows you to apply certain conditions or checks before a route function is executed, such as `authentication` or `authorization` checks.
408
408
This can help to ensure that only authorized users can access certain resources.
409
409
410
410
More information on how to use this decorator can be found in the [Guard Documentation]()
411
411
412
-
A quick example on how to use `guards` decorator:
412
+
A quick example on how to use `Guards` decorator:
413
413
```python
414
414
import typing as t
415
-
from ellar.common import get, guards
415
+
from ellar.common import get, Guards
416
416
from ellar.core.guard import APIKeyQuery
417
417
from ellar.core.connection import HTTPConnection
418
418
@@ -425,11 +425,11 @@ class MyAPIKeyQuery(APIKeyQuery):
425
425
426
426
427
427
@get("/")
428
-
@guards(MyAPIKeyQuery(), )
428
+
@Guards(MyAPIKeyQuery(), )
429
429
asyncdefget_guarded_items(self):
430
430
return {'message': 'worked fine with `key`=`supersecret`'}
431
431
```
432
-
The `guards` decorator, like the `version` decorator, takes a list of values as an argument.
432
+
The `Guards` decorator, like the `version` decorator, takes a list of values as an argument.
433
433
During a request, the provided guards are called in the order in which they are provided.
434
434
435
435
This allows you to apply multiple guards to a single route function and have them executed in a specific order.
0 commit comments