Skip to content

Commit

Permalink
change name from of to eitherOf
Browse files Browse the repository at this point in the history
  • Loading branch information
jpelay committed Jun 11, 2024
1 parent a28e451 commit 5e90276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions website/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from . import dynamo, auth
from . import querylog

from .dynamo import DictOf, Optional, ListOf, SetOf, RecordOf, Or
from .dynamo import DictOf, Optional, ListOf, SetOf, RecordOf, EitherOf

is_offline = getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS')
if is_offline:
Expand Down Expand Up @@ -164,7 +164,7 @@ def only_in_dev(x):
'creator': str,
'name': str,
'classes': Optional(ListOf(str)),
'level': Or(str, int), # this might be a string or a int
'level': EitherOf(str, int), # this might be a string or a int
'levels': ListOf(str),
'content': str,
'public': int,
Expand Down
2 changes: 1 addition & 1 deletion website/dynamo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@ def __str__(self):
return f'instance of {self.type}'


class Or(Validator):
class EitherOf(Validator):
"""Validator wihch checks if a value is instance of one of several types"""

def __init__(self, *types):
Expand Down

0 comments on commit 5e90276

Please sign in to comment.