Skip to content

Commit 9c4e839

Browse files
committed
doc updates
1 parent 5bdd710 commit 9c4e839

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/api_controller/model_controller.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# **Model APIController**
2+
Model Controllers dynamically creates **CRUD** operations for a **Django ORM** model in a controller based on some configurations.
3+
24
Model Controllers extend the `ControllerBase` class and introduce two configuration variables, namely `model_config` and `model_service`.
35

4-
The `model_config` is responsible for defining configurations related to routes and schema generation, while the `model_service` refers to a class that manages CRUD (Create, Read, Update, Delete) operations for the specified model.
6+
- `model_config` is responsible for defining configurations related to routes and schema generation
7+
- `model_service` refers to a class that manages CRUD (Create, Read, Update, Delete) operations for the specified model.
58

69
For example, consider the definition of an `Event` model in Django:
710

@@ -369,7 +372,7 @@ In the above illustration, we created `add_event_to_new_category` as an asynchro
369372
`handle_add_event_to_new_category` to asynchronous function as well.
370373

371374

372-
### **QueryGetter and ObjectGetter**
375+
## **QueryGetter and ObjectGetter**
373376
`ModelEndpointFactory` exposes a more flexible way to get a model object or get a queryset filter in the case of
374377
`ModelEndpointFactory.find_one` and `ModelEndpointFactory.list`, respectively.
375378

@@ -436,7 +439,7 @@ Note that our `queryset_getter` may fail if an invalid ID is supplied, as this i
436439
Also, keep in mind that `model_config` settings like `create_schema`, `retrieve_schema`, `patch_schema`, and `update_schema`
437440
are all available after ModelConfig instantiation.
438441

439-
### **Path and Query Parameters**
442+
## **Path and Query Parameters**
440443

441444
In `ModelEndpointFactory`, path parameters are parsed to identify both `path` and `query` parameters.
442445
These parameters are then created as fields within the Ninja input schema and resolved during the request,

0 commit comments

Comments
 (0)