From 650154f033acdae454f7fc9aa3ee83fa9f67b7ad Mon Sep 17 00:00:00 2001 From: collerek Date: Wed, 23 Sep 2020 10:32:49 +0200 Subject: [PATCH] update readme to include choices --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a403d1a..730444c 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,6 @@ import sqlalchemy database = databases.Database("sqlite:///db.sqlite") metadata = sqlalchemy.MetaData() - class Note(ormar.Model): class Meta: tablename = "notes" @@ -63,6 +62,8 @@ class Note(ormar.Model): id: ormar.Integer(primary_key=True) text: ormar.String(length=100) completed: ormar.Boolean(default=False) + # as of ormar >=0.3.2 you can provide a list of choices that will be validated + flag: ormar.String(default='To do', choices=['To do', 'Pending', 'Done']) # Create the database engine = sqlalchemy.create_engine(str(database.url))