Skip to content

Commit

Permalink
Clarify that attributes with default values are excluded
Browse files Browse the repository at this point in the history
Relates to #231
  • Loading branch information
jacebrowning committed Jul 10, 2021
1 parent 1c52c9e commit cda2ed1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/api/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ Item("abc") # <=> items/abc.yml
Item("def") # <=> items/def.yml
```

Attributes included in the filename pattern are automatically excluded from the file contents.
Filename patterns are relative to the file in which models are defined unless `<pattern>` is an absolute path or explicitly relative to the current directory:
Filename patterns are relative to the file in which the model is defined unless `<pattern>` is an absolute path or explicitly relative to the current directory:

- Absolute: `/tmp/items/{self.name}.yml`
- Relative to model: `items/{self.name}.yml`
- Relative to current directory: `./items/{self.name}.yml`

Attributes included in the filename pattern and those with default value are automatically excluded from serialization since these redundant values are not required to restore objects from disk.

<h3>Options</h3>

The following options can be passed to the `@datafile()` decorator:
Expand Down

0 comments on commit cda2ed1

Please sign in to comment.