From 3ebf529934ad4932a0dd7deeffa31c4deee2e72d Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Tue, 7 May 2024 16:42:41 +0200 Subject: Initial autokey functionality --- README.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'README.md') 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 -- cgit v1.3.1