From 05120998c416d7d2ad21ba8abf31d5d7be2db830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E4=BC=9F?= Date: Tue, 18 Apr 2023 10:44:22 +0800 Subject: [PATCH] add choices() classmethod to Options for django --- optenum/options.py | 5 ++++- optenum/version.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/optenum/options.py b/optenum/options.py index 1109e7f..630bdc0 100644 --- a/optenum/options.py +++ b/optenum/options.py @@ -327,7 +327,10 @@ class DoorState(Options): ``` """ - pass + @classmethod + def choices(cls): + # for django choices + return cls.get_list('code', 'text') __all__ = ('Options', 'OptionGroup') diff --git a/optenum/version.py b/optenum/version.py index eb53676..bb183ed 100644 --- a/optenum/version.py +++ b/optenum/version.py @@ -1,3 +1,3 @@ """ version file """ -__version__ = '1.1.8' +__version__ = '1.1.9'