mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
[3.0.x] Fixed #31313 -- Fixed is_upperclass() example in enumeration types docs.
Backport of f1016814d8
from master
This commit is contained in:
parent
ae6c6f9110
commit
59ac25c93b
1 changed files with 4 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue