diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -6,14 +6,18 @@ Define a dataclass: ```python from dataclasses import dataclass +from typing import ClassVar @dataclass class User: name: str age: int active: bool + key: ClassVar[str] = "name" ``` +Note the `key` field which is used to denote that `name` should be used as the primary key field. + Instantiate a new object: ```python |
