diff options
| author | Andrey Doroschenko <dorosch.github.io@yandex.ru> | 2020-02-27 08:26:52 +0300 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-02-27 08:33:51 +0100 |
| commit | 59ac25c93b228cd4ef34d4f36fbfbab3d9f6b4ad (patch) | |
| tree | b9224e7262359a2c824da484075c44c3f5affbf2 /docs | |
| parent | ae6c6f9110a0bd30a72c5bc5067920ba2725dc6b (diff) | |
[3.0.x] Fixed #31313 -- Fixed is_upperclass() example in enumeration types docs.
Backport of f1016814d84b1423cfe0df85644c9870a6bc6b41 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/models/fields.txt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index dfd9f9b665..f997921148 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: |
