forked from openlp/openlp
added __hash__ methods
This commit is contained in:
parent
7a33b93473
commit
143ce0015f
@ -485,6 +485,12 @@ class ServiceItem(object):
|
|||||||
"""
|
"""
|
||||||
return self.unique_identifier != other.unique_identifier
|
return self.unique_identifier != other.unique_identifier
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
"""
|
||||||
|
Return the hash for the service item.
|
||||||
|
"""
|
||||||
|
return self.unique_identifier
|
||||||
|
|
||||||
def is_media(self):
|
def is_media(self):
|
||||||
"""
|
"""
|
||||||
Confirms if the ServiceItem is media
|
Confirms if the ServiceItem is media
|
||||||
|
@ -41,14 +41,19 @@ class CustomSlide(BaseModel):
|
|||||||
"""
|
"""
|
||||||
CustomSlide model
|
CustomSlide model
|
||||||
"""
|
"""
|
||||||
# By default sort the customs by its title considering language specific
|
# By default sort the customs by its title considering language specific characters.
|
||||||
# characters.
|
|
||||||
def __lt__(self, other):
|
def __lt__(self, other):
|
||||||
return get_locale_key(self.title) < get_locale_key(other.title)
|
return get_locale_key(self.title) < get_locale_key(other.title)
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return get_locale_key(self.title) == get_locale_key(other.title)
|
return get_locale_key(self.title) == get_locale_key(other.title)
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
"""
|
||||||
|
Return the hash for a custom slide.
|
||||||
|
"""
|
||||||
|
return self.id
|
||||||
|
|
||||||
|
|
||||||
def init_schema(url):
|
def init_schema(url):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user