|
@@ -10,7 +10,7 @@ from EditorialModel.fields import EmField
|
10
|
10
|
from EditorialModel.types import EmType
|
11
|
11
|
from EditorialModel.exceptions import *
|
12
|
12
|
import EditorialModel
|
13
|
|
-
|
|
13
|
+import hashlib
|
14
|
14
|
|
15
|
15
|
## Manages the Editorial Model
|
16
|
16
|
class Model(object):
|
|
@@ -26,6 +26,12 @@ class Model(object):
|
26
|
26
|
self._components = {'uids': {}, 'EmClass': [], 'EmType': [], 'EmField': [], 'EmFieldGroup': []}
|
27
|
27
|
self.load()
|
28
|
28
|
|
|
29
|
+ def __hash__(self):
|
|
30
|
+ return hashlib.md5(str({uid: component.__hash__ for uid, component in self._components.items()}).encode('utf-8')).hexdigest()
|
|
31
|
+
|
|
32
|
+ # def __eq__(self, other):
|
|
33
|
+ # return self.__hash__() == other.__hash__()
|
|
34
|
+
|
29
|
35
|
@staticmethod
|
30
|
36
|
## Given a name return an EmComponent child class
|
31
|
37
|
# @param class_name str : The name to identify an EmComponent class
|