gallery.accords-library.com/server/szurubooru/search/criteria.py

24 lines
825 B
Python
Raw Normal View History

class _BaseSearchCriterion(object):
2016-04-02 12:40:10 +00:00
def __init__(self, original_text, negated):
self.original_text = original_text
self.negated = negated
def __repr__(self):
return self.original_text
class RangedSearchCriterion(_BaseSearchCriterion):
2016-04-02 12:40:10 +00:00
def __init__(self, original_text, negated, min_value, max_value):
super().__init__(original_text, negated)
self.min_value = min_value
self.max_value = max_value
2016-04-17 16:15:59 +00:00
class PlainSearchCriterion(_BaseSearchCriterion):
2016-04-02 12:40:10 +00:00
def __init__(self, original_text, negated, value):
super().__init__(original_text, negated)
self.value = value
class ArraySearchCriterion(_BaseSearchCriterion):
2016-04-02 12:40:10 +00:00
def __init__(self, original_text, negated, values):
super().__init__(original_text, negated)
self.values = values