From 15fd5b4fa258e649b72d37b60f7021239edf6e6f Mon Sep 17 00:00:00 2001 From: Grant Ramsay Date: Mon, 27 Jan 2025 19:42:35 +0000 Subject: [PATCH] update the demo file Signed-off-by: Grant Ramsay --- demo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/demo.py b/demo.py index 2c00f6c..124baee 100644 --- a/demo.py +++ b/demo.py @@ -10,7 +10,7 @@ from __future__ import annotations import logging -from typing import Optional +from typing import ClassVar, Optional from sqliter import SqliterDB from sqliter.exceptions import RecordInsertionError @@ -26,6 +26,7 @@ class UserModel(BaseDBModel): content: Optional[str] admin: bool = False list_of_str: list[str] + a_set: ClassVar[set[str]] = set() class Meta: """Override the table name for the UserModel.""" @@ -51,6 +52,7 @@ def main() -> None: content="This is information about John Doe.", admin=True, list_of_str=["a", "b", "c"], + a_set={"x", "y", "z"}, ) user2 = UserModel( slug="jdoe2", @@ -63,6 +65,7 @@ def main() -> None: name="Yogie Bear", content=None, list_of_str=[], + a_set={"apple", "banana", "cherry"}, ) try: db.insert(user1)