|
|
@ -1,4 +1,5 @@ |
|
|
|
from .exceptions import MemberNotFoundException |
|
|
|
import hashlib |
|
|
|
|
|
|
|
|
|
|
|
class Event(): |
|
|
@ -45,7 +46,24 @@ class Event(): |
|
|
|
|
|
|
|
except MemberNotFoundException: |
|
|
|
print( |
|
|
|
f"Member with id {row[0]} not found, group id: {self.id}") |
|
|
|
"Member with id {row[0]} not found, group id:" + |
|
|
|
f"{self.id}") |
|
|
|
|
|
|
|
def __eq__(self, other): |
|
|
|
if isinstance(other, Event): |
|
|
|
return self.hash() == other.hash() |
|
|
|
|
|
|
|
def hash(self): |
|
|
|
return hashlib.md5((str(self.rol_id) |
|
|
|
+ self.start_time.strftime("%Y-%m-%d %H:%M:%S") |
|
|
|
+ self.end_time.strftime("%Y-%m-%d %H:%M:%S") |
|
|
|
+ str(self.id) |
|
|
|
+ (''.join(str(y) |
|
|
|
for x, y in self.participants) or '') |
|
|
|
+ (''.join(str(y) for x, y in self.leaders) or '') |
|
|
|
+ self.name + (self.description or '') + |
|
|
|
(self.location or '') |
|
|
|
+ str(self.cat_id)).encode('utf-8')).hexdigest() |
|
|
|
|
|
|
|
def getAllMembers(self): |
|
|
|
"""Return leaders and members in group, combined""" |
|
|
|