2017-04-24 21:30:53 +00:00
|
|
|
from typing import List
|
2017-02-04 00:08:12 +00:00
|
|
|
|
2020-06-05 22:03:37 +00:00
|
|
|
from szurubooru.search import tokens
|
|
|
|
|
2017-02-04 00:08:12 +00:00
|
|
|
|
|
|
|
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:
|
2020-06-05 22:03:37 +00:00
|
|
|
return hash(
|
|
|
|
(
|
|
|
|
tuple(self.anonymous_tokens),
|
|
|
|
tuple(self.named_tokens),
|
|
|
|
tuple(self.special_tokens),
|
|
|
|
tuple(self.sort_tokens),
|
|
|
|
)
|
|
|
|
)
|