rr- ad842ee8a5 server: refactor + add type hinting
- Added type hinting (for now, 3.5-compatible)
- Split `db` namespace into `db` module and `model` namespace
- Changed elastic search to be created lazily for each operation
- Changed to class based approach in entity serialization to allow
  stronger typing
- Removed `required` argument from `context.get_*` family of functions;
  now it's implied if `default` argument is omitted
- Changed `unalias_dict` implementation to use less magic inputs
2017-02-05 16:34:45 +01:00

17 lines
568 B
Python

from szurubooru.search import tokens
class SearchQuery:
def __init__(self) -> None:
self.anonymous_tokens = [] # type: List[tokens.AnonymousToken]
self.named_tokens = [] # type: List[tokens.NamedToken]
self.special_tokens = [] # type: List[tokens.SpecialToken]
self.sort_tokens = [] # type: List[tokens.SortToken]
def __hash__(self) -> int:
return hash((
tuple(self.anonymous_tokens),
tuple(self.named_tokens),
tuple(self.special_tokens),
tuple(self.sort_tokens)))