Skip to content

Commit c417682

Browse files
committed
doc cleanup pass
1 parent 87b2481 commit c417682

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/docs/guides/response/django-pydantic.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Schemas are very useful to define your validation rules and responses, but somet
55

66
## ModelSchema
77

8-
`ModelSchema` is a special base class that can automatically generate schemas from your models. Under the hood it converts your models Django fields into
9-
pydantic type annotations. `ModelSchema` inherits from `Schema`, and is just a `Schema` with a Django field -> pydantic field conversion step. All other `Schema`
8+
`ModelSchema` is a special base class that can automatically generate schemas from your models. Under the hood it converts your Django `Model` fields into
9+
type annotations. `ModelSchema` inherits from `Schema`, and is just a `Schema` with a Django field to pydantic field conversion step. All other `Schema`
1010
related configuration and inheritance is the same.
1111

1212
### Configuration
1313

1414
To configure a `ModelSchema` you define a `Meta` class attribute just like in Django. This `Meta` class will be validated by `ninja.orm.metaclass.MetaConf`.
1515

16-
```Python
16+
```
1717
class MetaConf: # summary
1818
model: Django model being used to create the Schema
1919
fields: List of field names in the model to use. Defaults to '__all__' which includes all fields
@@ -45,9 +45,9 @@ class UserSchema(ModelSchema):
4545

4646
### Non-Django Model Configuration
4747

48-
The `Meta` class is only used for configuring the interaction between the django model and the underlying
49-
`Schema`. To configure the pydantic model underlying the `Schema` define, `model_config` in your
50-
`ModelSchema` class, or [use the deprecated by pydantic `class Config`](https://docs.pydantic.dev/latest/concepts/config/).
48+
The `Meta` class is only used for configuring the interaction between the Django `Model` and the underlying
49+
`Schema`. To configure the pydantic model underlying the `Schema`, [define `model_config`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_config)
50+
in your `ModelSchema` class or [use the deprecated \(by pydantic\) `class Config`](https://docs.pydantic.dev/latest/concepts/config/).
5151

5252
```Python
5353
class UserSlimGetSchema(ModelSchema):

0 commit comments

Comments
 (0)