summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7eebf3e..9cfc571 100644
--- a/README.md
+++ b/README.md
@@ -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