Browse Source

Em: draft for fieldgroup

ArnAud 9 years ago
parent
commit
55b030800f
2 changed files with 7 additions and 0 deletions
  1. 4
    0
      EditorialModel/model.py
  2. 3
    0
      EditorialModel/test/me.json

+ 4
- 0
EditorialModel/model.py View File

@@ -4,12 +4,15 @@
4 4
 # Manage instance of an editorial model
5 5
 
6 6
 from EditorialModel.classes import EmClass
7
+from EditorialModel.fieldgroups import EmFieldGroup
8
+
7 9
 
8 10
 
9 11
 ## Manages the Editorial Model
10 12
 class Model(object):
11 13
 
12 14
     componentClass = EmClass
15
+    componentFieldGroup = EmFieldGroup
13 16
 
14 17
     ## Constructor
15 18
     #
@@ -30,6 +33,7 @@ class Model(object):
30 33
             if cls:
31 34
                 component['uid'] = uid
32 35
                 self.uids[uid] = cls(component)
36
+                print (self.uids[uid])
33 37
 
34 38
     ## Saves data using the current backend
35 39
     def save(self):

+ 3
- 0
EditorialModel/test/me.json View File

@@ -4,5 +4,8 @@
4 4
   },
5 5
   "2" : {
6 6
     "component":"Class", "name":"publications", "string":"{\"fre\":\"Rubriques\"}", "help":"{}", "rank":"1", "date_update":"", "date_create":"", "classtype":"entity", "icon":"0", "sortcolumn":"rank"
7
+  },
8
+  "3" : {
9
+    "component":"FieldGroup", "name":"metadonne", "string":"{\"fre\":\"Rubriques\"}", "help":"{}", "rank":"1", "date_update":"", "date_create":"", "class_id":"1"
7 10
   }
8 11
 }

Loading…
Cancel
Save