diff options
| author | Yuval Adam <_@yuv.al> | 2024-05-07 16:42:41 +0200 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2024-05-07 20:56:12 +0200 |
| commit | 3ebf529934ad4932a0dd7deeffa31c4deee2e72d (patch) | |
| tree | 654661de06a717d0f0921a2aa6de7c168ca2ff74 /README.md | |
| parent | 966cb2525d060f0b80e2d32277cf212c23625f47 (diff) | |
Initial autokey functionality
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 |
