Skip to content

Commit 2d469a6

Browse files
committed
fix docs
1 parent 0c52c48 commit 2d469a6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/index.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,13 +2446,16 @@ nested_field = "world!"
24462446
You can also provide multiple files by providing a list of paths.
24472447

24482448
```py
2449+
from pydantic import BaseModel
2450+
24492451
from pydantic_settings import (
24502452
BaseSettings,
24512453
PydanticBaseSettingsSource,
24522454
SettingsConfigDict,
24532455
TomlConfigSettingsSource,
24542456
)
24552457

2458+
24562459
class Nested(BaseModel):
24572460
foo: int
24582461
bar: int = 0
@@ -2461,7 +2464,9 @@ class Nested(BaseModel):
24612464
class Settings(BaseSettings):
24622465
hello: str
24632466
nested: Nested
2464-
model_config = SettingsConfigDict(toml_file=['config.default.toml', 'config.custom.toml'])
2467+
model_config = SettingsConfigDict(
2468+
toml_file=['config.default.toml', 'config.custom.toml']
2469+
)
24652470

24662471
@classmethod
24672472
def settings_customise_sources(
@@ -2507,13 +2512,16 @@ The files are merged shallowly in increasing order of priority. To enable deep m
25072512
The `deep_merge` option is **not available** through the `SettingsConfigDict`.
25082513

25092514
```py
2515+
from pydantic import BaseModel
2516+
25102517
from pydantic_settings import (
25112518
BaseSettings,
25122519
PydanticBaseSettingsSource,
25132520
SettingsConfigDict,
25142521
TomlConfigSettingsSource,
25152522
)
25162523

2524+
25172525
class Nested(BaseModel):
25182526
foo: int
25192527
bar: int = 0
@@ -2522,7 +2530,9 @@ class Nested(BaseModel):
25222530
class Settings(BaseSettings):
25232531
hello: str
25242532
nested: Nested
2525-
model_config = SettingsConfigDict(toml_file=['config.default.toml', 'config.custom.toml'])
2533+
model_config = SettingsConfigDict(
2534+
toml_file=['config.default.toml', 'config.custom.toml']
2535+
)
25262536

25272537
@classmethod
25282538
def settings_customise_sources(

0 commit comments

Comments
 (0)