|
@@ -28,7 +28,7 @@ class Model(object):
|
28
|
28
|
|
29
|
29
|
## Loads the structure of the Editorial Model
|
30
|
30
|
#
|
31
|
|
- # Gets all the objects contained in that structure and creates a list indexed by their uids
|
|
31
|
+ # Gets all the objects contained in that structure and creates a dict indexed by their uids
|
32
|
32
|
def load(self):
|
33
|
33
|
data = self.backend.load()
|
34
|
34
|
for uid, component in data.items():
|
|
@@ -38,6 +38,11 @@ class Model(object):
|
38
|
38
|
component['uid'] = uid
|
39
|
39
|
self.uids[uid] = cls(component)
|
40
|
40
|
print (self.uids[uid])
|
|
41
|
+ # TODO
|
|
42
|
+ # iterate over classes, link to subordinates types
|
|
43
|
+ # iterate over types, attach them to classes
|
|
44
|
+ # iterate over fieldgroups, attach them to classes
|
|
45
|
+ # iterate over fields, attach them to fieldgroups, link to types, link to relational fields
|
41
|
46
|
|
42
|
47
|
## Saves data using the current backend
|
43
|
48
|
def save(self):
|
|
@@ -51,5 +56,5 @@ class Model(object):
|
51
|
56
|
|
52
|
57
|
## Returns a list of all the EmClass objects of the model
|
53
|
58
|
def classes(self):
|
54
|
|
- classes = [component for _, component in self.uids if isinstance(component, EmClass)]
|
|
59
|
+ classes = [component for component in self.uids.values() if isinstance(component, EmClass)]
|
55
|
60
|
return classes
|