From f1016814d84b1423cfe0df85644c9870a6bc6b41 Mon Sep 17 00:00:00 2001 From: Andrey Doroschenko Date: Thu, 27 Feb 2020 08:26:52 +0300 Subject: [PATCH] Fixed #31313 -- Fixed is_upperclass() example in enumeration types docs. --- docs/ref/models/fields.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index d321506d99..c0a005e7a9 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -204,7 +204,10 @@ choices in a concise way:: ) def is_upperclass(self): - return self.year_in_school in {YearInSchool.JUNIOR, YearInSchool.SENIOR} + return self.year_in_school in { + self.YearInSchool.JUNIOR, + self.YearInSchool.SENIOR, + } These work similar to :mod:`enum` from Python's standard library, but with some modifications: