|
@@ -1,208 +1,206 @@
|
1
|
|
-##@defgroup lodel2_leapi LeAPI
|
2
|
|
-#@brief Lodel2 Editorial API
|
|
1
|
+## @defgroup lodel2_leapi LeAPI
|
|
2
|
+# @brief Lodel2 Editorial API
|
3
|
3
|
#
|
4
|
|
-#Provide access to datas via objects as defined in the Editorial Model
|
|
4
|
+# Provides access to any kind of data in Lodel2, using classes
|
|
5
|
+# defined by the Editorial Model
|
5
|
6
|
|
6
|
|
-##@package lodel.leapi
|
7
|
|
-#@brief Lodel2 Editorial API
|
|
7
|
+## @package lodel.leapi
|
|
8
|
+# @brief Lodel2 Editorial API
|
8
|
9
|
#
|
9
|
10
|
# Defines an API to access to objects as described by
|
10
|
|
-#@ref lodel.editorial_model "Editorial Model"
|
|
11
|
+# @ref lodel.editorial_model "Editorial Model"
|
11
|
12
|
|
12
|
|
-##@page lodel2_leapi_page LeAPI
|
13
|
|
-#@ingroup lodel2_leapi
|
|
13
|
+## @page lodel2_leapi_page LeAPI
|
|
14
|
+# @ingroup lodel2_leapi
|
14
|
15
|
#
|
15
|
16
|
# @section lodel2_leapi_base LeAPI (Lodel Editorial API)
|
16
|
17
|
#
|
17
|
|
-# LeAPI is an API that provide access to datas as defined in an
|
18
|
|
-#@ref lodel2_em "Editorial Model".
|
|
18
|
+# LeAPI is an API that provides access to data as defined in an
|
|
19
|
+# @ref lodel2_em "Editorial Model".
|
19
|
20
|
#
|
20
|
|
-#@subsection lodel2_leapi_gen LeAPI dynamic code & LeFactory
|
|
21
|
+# @subsection lodel2_leapi_gen LeAPI dynamic code & LeFactory
|
21
|
22
|
#
|
22
|
|
-#LeAPI python code is programmaticaly generated by
|
23
|
|
-#@ref lodel.leapi.lefactory "LeFactory". LeFactory generates
|
24
|
|
-#@ref lodel.leapi.leobject.LeObject "LeObject" child classes.
|
|
23
|
+# LeAPI's python code is programmaticaly generated by
|
|
24
|
+# @ref lodel.leapi.lefactory "LeFactory", who generates
|
|
25
|
+# @ref lodel.leapi.leobject.LeObject "LeObject" child classes.
|
25
|
26
|
#
|
26
|
|
-#@par Example
|
|
27
|
+# @par Example
|
|
28
|
+#
|
27
|
29
|
#<pre>
|
28
|
|
-#
|
29
|
|
-# from lodel.leapi.leobject import LeObject
|
30
|
|
-# from lodel.leapi.datahandlers.base_classes import DataField
|
|
30
|
+#from lodel.leapi.leobject import LeObject
|
|
31
|
+#from lodel.leapi.datahandlers.base_classes import DataField
|
|
32
|
+#from lodel.plugin.hooks import LodelHook
|
|
33
|
+#
|
|
34
|
+#class Abstract_Object(LeObject):
|
|
35
|
+# _abstract = True
|
|
36
|
+# _fields = None
|
|
37
|
+# _uid = []
|
|
38
|
+# _ro_datasource = None
|
|
39
|
+# _rw_datasource = None
|
|
40
|
+# _datasource_name = 'default'
|
|
41
|
+# _child_classes = None
|
|
42
|
+#
|
|
43
|
+#
|
|
44
|
+#class User(LeObject):
|
|
45
|
+# _abstract = False
|
|
46
|
+# _fields = None
|
|
47
|
+# _uid = ['id']
|
|
48
|
+# _ro_datasource = None
|
|
49
|
+# _rw_datasource = None
|
|
50
|
+# _datasource_name = 'default'
|
|
51
|
+# _child_classes = None
|
|
52
|
+#
|
|
53
|
+#
|
|
54
|
+#class Object(Abstract_Object):
|
|
55
|
+# _abstract = True
|
|
56
|
+# _fields = None
|
|
57
|
+# _uid = ['lodel_id']
|
|
58
|
+# _ro_datasource = None
|
|
59
|
+# _rw_datasource = None
|
|
60
|
+# _datasource_name = 'default'
|
|
61
|
+# _child_classes = None
|
|
62
|
+#
|
|
63
|
+#
|
|
64
|
+#class Entry(Object):
|
|
65
|
+# _abstract = True
|
|
66
|
+# _fields = None
|
|
67
|
+# _uid = ['lodel_id']
|
|
68
|
+# _ro_datasource = None
|
|
69
|
+# _rw_datasource = None
|
|
70
|
+# _datasource_name = 'default'
|
|
71
|
+# _child_classes = None
|
|
72
|
+#
|
|
73
|
+#
|
|
74
|
+#class Entitie(Object):
|
|
75
|
+# _abstract = True
|
|
76
|
+# _fields = None
|
|
77
|
+# _uid = ['lodel_id']
|
|
78
|
+# _ro_datasource = None
|
|
79
|
+# _rw_datasource = None
|
|
80
|
+# _datasource_name = 'default'
|
|
81
|
+# _child_classes = None
|
|
82
|
+#
|
|
83
|
+#
|
|
84
|
+#class Person(Object):
|
|
85
|
+# _abstract = False
|
|
86
|
+# _fields = None
|
|
87
|
+# _uid = ['lodel_id']
|
|
88
|
+# _ro_datasource = None
|
|
89
|
+# _rw_datasource = None
|
|
90
|
+# _datasource_name = 'default'
|
|
91
|
+# _child_classes = None
|
|
92
|
+#
|
|
93
|
+#class Text(Entitie):
|
|
94
|
+# _abstract = True
|
|
95
|
+# _fields = None
|
|
96
|
+# _uid = ['lodel_id']
|
|
97
|
+# _ro_datasource = None
|
|
98
|
+# _rw_datasource = None
|
|
99
|
+# _datasource_name = 'default'
|
|
100
|
+# _child_classes = None
|
|
101
|
+#
|
|
102
|
+#
|
|
103
|
+#class Publication(Entitie):
|
|
104
|
+# _abstract = False
|
|
105
|
+# _fields = None
|
|
106
|
+# _uid = ['lodel_id']
|
|
107
|
+# _ro_datasource = None
|
|
108
|
+# _rw_datasource = None
|
|
109
|
+# _datasource_name = 'default'
|
|
110
|
+# _child_classes = None
|
|
111
|
+#
|
|
112
|
+#Abstract_Object._set__fields({})
|
|
113
|
+#Abstract_Object._child_classes = (Section, Text, Object, Entry, Collection, Text_Person, Entitie, Indextheme, Person, Indexabs, Publication, Subsection,)
|
|
114
|
+#User._set__fields({
|
|
115
|
+# 'firstname': DataField.from_name('varchar')(**{ 'internal': False }),
|
|
116
|
+# 'lastname': DataField.from_name('varchar')(**{ 'internal': False }),
|
|
117
|
+# 'classname': DataField.from_name('LeobjectSubclassIdentifier')(**{ 'internal': True }),
|
|
118
|
+# 'login': DataField.from_name('varchar')(**{ 'internal': True, 'uniq': True }),
|
|
119
|
+# 'id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
|
120
|
+# 'password': DataField.from_name('password')(**{ 'internal': False })})
|
|
121
|
+#User._child_classes = tuple()
|
|
122
|
+#Object._set__fields({
|
|
123
|
+# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
|
124
|
+# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
|
125
|
+# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
|
126
|
+# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
|
127
|
+#Object._child_classes = (Section, Text, Entry, Collection, Text_Person, Entitie, Indextheme, Person, Indexabs, Publication, Subsection,)
|
|
128
|
+#Entry._set__fields({
|
|
129
|
+# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
|
130
|
+# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
|
131
|
+# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
|
132
|
+# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
|
133
|
+#Entry._child_classes = tuple()
|
|
134
|
+#Entitie._set__fields({
|
|
135
|
+# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
|
136
|
+# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
|
137
|
+# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
|
138
|
+# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
|
139
|
+#Entitie._child_classes = (Section, Text, Text_Person, Collection, Publication, Subsection,)
|
|
140
|
+#Person._set__fields({
|
|
141
|
+# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
|
142
|
+# 'firstname': DataField.from_name('varchar')(**{ }),
|
|
143
|
+# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
|
144
|
+# 'linked_texts': DataField.from_name('list')(**{ 'nullable': True, 'default': None, 'allowed_classes': [Text], 'back_reference': (Text, 'linked_persons') }),
|
|
145
|
+# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
|
146
|
+# 'lastname': DataField.from_name('varchar')(**{ }),
|
|
147
|
+# 'fullname': DataField.from_name('Concat')(**{ 'field_list': ['firstname', 'lastname'], 'immutable': True }),
|
|
148
|
+# 'classname': DataField.from_name('LeobjectSubclassIdentifier')(**{ 'internal': True }),
|
|
149
|
+# 'alias': DataField.from_name('set')(**{ 'nullable': True, 'default': None, 'allowed_classes': [Person] }),
|
|
150
|
+# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
|
151
|
+#Person._child_classes = tuple()
|
|
152
|
+#Text._set__fields({
|
|
153
|
+# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
|
154
|
+# 'subtitle': DataField.from_name('varchar')(**{ 'nullable': True, 'default': None }),
|
|
155
|
+# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
|
156
|
+# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
|
157
|
+# 'linked_persons': DataField.from_name('list')(**{ 'nullable': True, 'default': None, 'allowed_classes': [Person], 'back_reference': (Person, 'linked_texts') }),
|
|
158
|
+# 'indexes': DataField.from_name('list')(**{ 'nullable': True, 'default': None, 'allowed_classes': [Indexabs], 'back_reference': (Indexabs, 'texts') }),
|
|
159
|
+# 'title': DataField.from_name('varchar')(**{ 'nullable': True }),
|
|
160
|
+# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
|
161
|
+#Text._child_classes = (Section, Subsection,)
|
|
162
|
+#Publication._set__fields({
|
|
163
|
+# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
|
164
|
+# 'classname': DataField.from_name('LeobjectSubclassIdentifier')(**{ 'internal': True }),
|
|
165
|
+# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
|
166
|
+# 'collection': DataField.from_name('link')(**{ 'back_reference': (Collection, 'publications') }),
|
|
167
|
+# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
|
168
|
+# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
|
169
|
+#Publication._child_classes = tuple()
|
|
170
|
+#
|
|
171
|
+#\# List of dynamically generated classes
|
|
172
|
+#dynclasses = [Abstract_Object, User, Object, Entry, Entitie, Person, Indexabs, Text, Publication, Collection, Indextheme, Text_Person, Section, Subsection]
|
|
173
|
+#\# Dict of dynamically generated classes indexed by name
|
|
174
|
+#dynclasses_dict = {'Abstract_Object': Abstract_Object, 'User': User, 'Object': Object, 'Entry': Entry, 'Entitie': Entitie, 'Person': Person, 'Indexabs': Indexabs, 'Text': Text, 'Publication': Publication, 'Collection': Collection, 'Indextheme': Indextheme, 'Text_Person': Text_Person, 'Section': Section, 'Subsection': Subsection}
|
|
175
|
+#
|
|
176
|
+#
|
|
177
|
+#\#\# \@brief Return a dynamically generated class given it's name
|
|
178
|
+#\# \@param name str : The dynamic class name
|
|
179
|
+#\# \@return False or a child class of LeObject
|
|
180
|
+#def name2class(name):
|
|
181
|
+# if name not in dynclasses_dict:
|
|
182
|
+# return False
|
|
183
|
+# return dynclasses_dict[name]
|
|
184
|
+#
|
|
185
|
+#
|
|
186
|
+#\#\# \@brief Return a dynamically generated class given it's name
|
|
187
|
+#\# \@note Case insensitive version of name2class
|
|
188
|
+#\# \@param name str
|
|
189
|
+#\# \@retrun False or a child class of LeObject
|
|
190
|
+#def lowername2class(name):
|
|
191
|
+# name = name.lower()
|
|
192
|
+# new_dict = {k.lower():v for k,v in dynclasses_dict.items()}
|
|
193
|
+# if name not in new_dict:
|
|
194
|
+# return False
|
|
195
|
+# return new_dict[name]
|
|
196
|
+#
|
|
197
|
+#
|
|
198
|
+#\#\# \@brief Trigger dynclasses datasources initialisation
|
|
199
|
+#@LodelHook("lodel2_plugins_loaded")
|
|
200
|
+#def lodel2_dyncode_datasources_init(self, caller, payload):
|
|
201
|
+# for cls in dynclasses:
|
|
202
|
+# cls._init_datasources()
|
31
|
203
|
# from lodel.plugin.hooks import LodelHook
|
32
|
|
-#
|
33
|
|
-# class Abstract_Object(LeObject):
|
34
|
|
-# _abstract = True
|
35
|
|
-# _fields = None
|
36
|
|
-# _uid = []
|
37
|
|
-# _ro_datasource = None
|
38
|
|
-# _rw_datasource = None
|
39
|
|
-# _datasource_name = 'default'
|
40
|
|
-# _child_classes = None
|
41
|
|
-#
|
42
|
|
-#
|
43
|
|
-# class User(LeObject):
|
44
|
|
-# _abstract = False
|
45
|
|
-# _fields = None
|
46
|
|
-# _uid = ['id']
|
47
|
|
-# _ro_datasource = None
|
48
|
|
-# _rw_datasource = None
|
49
|
|
-# _datasource_name = 'default'
|
50
|
|
-# _child_classes = None
|
51
|
|
-#
|
52
|
|
-#
|
53
|
|
-# class Object(Abstract_Object):
|
54
|
|
-# _abstract = True
|
55
|
|
-# _fields = None
|
56
|
|
-# _uid = ['lodel_id']
|
57
|
|
-# _ro_datasource = None
|
58
|
|
-# _rw_datasource = None
|
59
|
|
-# _datasource_name = 'default'
|
60
|
|
-# _child_classes = None
|
61
|
|
-#
|
62
|
|
-#
|
63
|
|
-# class Entry(Object):
|
64
|
|
-# _abstract = True
|
65
|
|
-# _fields = None
|
66
|
|
-# _uid = ['lodel_id']
|
67
|
|
-# _ro_datasource = None
|
68
|
|
-# _rw_datasource = None
|
69
|
|
-# _datasource_name = 'default'
|
70
|
|
-# _child_classes = None
|
71
|
|
-#
|
72
|
|
-#
|
73
|
|
-# class Entitie(Object):
|
74
|
|
-# _abstract = True
|
75
|
|
-# _fields = None
|
76
|
|
-# _uid = ['lodel_id']
|
77
|
|
-# _ro_datasource = None
|
78
|
|
-# _rw_datasource = None
|
79
|
|
-# _datasource_name = 'default'
|
80
|
|
-# _child_classes = None
|
81
|
|
-#
|
82
|
|
-#
|
83
|
|
-# class Person(Object):
|
84
|
|
-# _abstract = False
|
85
|
|
-# _fields = None
|
86
|
|
-# _uid = ['lodel_id']
|
87
|
|
-# _ro_datasource = None
|
88
|
|
-# _rw_datasource = None
|
89
|
|
-# _datasource_name = 'default'
|
90
|
|
-# _child_classes = None
|
91
|
|
-#
|
92
|
|
-# class Text(Entitie):
|
93
|
|
-# _abstract = True
|
94
|
|
-# _fields = None
|
95
|
|
-# _uid = ['lodel_id']
|
96
|
|
-# _ro_datasource = None
|
97
|
|
-# _rw_datasource = None
|
98
|
|
-# _datasource_name = 'default'
|
99
|
|
-# _child_classes = None
|
100
|
|
-#
|
101
|
|
-#
|
102
|
|
-# class Publication(Entitie):
|
103
|
|
-# _abstract = False
|
104
|
|
-# _fields = None
|
105
|
|
-# _uid = ['lodel_id']
|
106
|
|
-# _ro_datasource = None
|
107
|
|
-# _rw_datasource = None
|
108
|
|
-# _datasource_name = 'default'
|
109
|
|
-# _child_classes = None
|
110
|
|
-#
|
111
|
|
-# Abstract_Object._set__fields({})
|
112
|
|
-# Abstract_Object._child_classes = (Section, Text, Object, Entry, Collection, Text_Person, Entitie, Indextheme, Person, Indexabs, Publication, Subsection,)
|
113
|
|
-# User._set__fields({
|
114
|
|
-# 'firstname': DataField.from_name('varchar')(**{ 'internal': False }),
|
115
|
|
-# 'lastname': DataField.from_name('varchar')(**{ 'internal': False }),
|
116
|
|
-# 'classname': DataField.from_name('LeobjectSubclassIdentifier')(**{ 'internal': True }),
|
117
|
|
-# 'login': DataField.from_name('varchar')(**{ 'internal': True, 'uniq': True }),
|
118
|
|
-# 'id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
119
|
|
-# 'password': DataField.from_name('password')(**{ 'internal': False })})
|
120
|
|
-# User._child_classes = tuple()
|
121
|
|
-# Object._set__fields({
|
122
|
|
-# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
123
|
|
-# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
124
|
|
-# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
125
|
|
-# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
126
|
|
-# Object._child_classes = (Section, Text, Entry, Collection, Text_Person, Entitie, Indextheme, Person, Indexabs, Publication, Subsection,)
|
127
|
|
-# Entry._set__fields({
|
128
|
|
-# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
129
|
|
-# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
130
|
|
-# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
131
|
|
-# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
132
|
|
-# Entry._child_classes = tuple()
|
133
|
|
-# Entitie._set__fields({
|
134
|
|
-# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
135
|
|
-# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
136
|
|
-# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
137
|
|
-# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
138
|
|
-# Entitie._child_classes = (Section, Text, Text_Person, Collection, Publication, Subsection,)
|
139
|
|
-# Person._set__fields({
|
140
|
|
-# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
141
|
|
-# 'firstname': DataField.from_name('varchar')(**{ }),
|
142
|
|
-# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
143
|
|
-# 'linked_texts': DataField.from_name('list')(**{ 'nullable': True, 'default': None, 'allowed_classes': [Text], 'back_reference': (Text, 'linked_persons') }),
|
144
|
|
-# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
145
|
|
-# 'lastname': DataField.from_name('varchar')(**{ }),
|
146
|
|
-# 'fullname': DataField.from_name('Concat')(**{ 'field_list': ['firstname', 'lastname'], 'immutable': True }),
|
147
|
|
-# 'classname': DataField.from_name('LeobjectSubclassIdentifier')(**{ 'internal': True }),
|
148
|
|
-# 'alias': DataField.from_name('set')(**{ 'nullable': True, 'default': None, 'allowed_classes': [Person] }),
|
149
|
|
-# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
150
|
|
-# Person._child_classes = tuple()
|
151
|
|
-# Text._set__fields({
|
152
|
|
-# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
153
|
|
-# 'subtitle': DataField.from_name('varchar')(**{ 'nullable': True, 'default': None }),
|
154
|
|
-# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
155
|
|
-# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
156
|
|
-# 'linked_persons': DataField.from_name('list')(**{ 'nullable': True, 'default': None, 'allowed_classes': [Person], 'back_reference': (Person, 'linked_texts') }),
|
157
|
|
-# 'indexes': DataField.from_name('list')(**{ 'nullable': True, 'default': None, 'allowed_classes': [Indexabs], 'back_reference': (Indexabs, 'texts') }),
|
158
|
|
-# 'title': DataField.from_name('varchar')(**{ 'nullable': True }),
|
159
|
|
-# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
160
|
|
-# Text._child_classes = (Section, Subsection,)
|
161
|
|
-# Publication._set__fields({
|
162
|
|
-# 'date_update': DataField.from_name('datetime')(**{ 'now_on_update': True, 'internal': True }),
|
163
|
|
-# 'classname': DataField.from_name('LeobjectSubclassIdentifier')(**{ 'internal': True }),
|
164
|
|
-# 'lodel_id': DataField.from_name('uniqid')(**{ 'internal': True }),
|
165
|
|
-# 'collection': DataField.from_name('link')(**{ 'back_reference': (Collection, 'publications') }),
|
166
|
|
-# 'help_text': DataField.from_name('text')(**{ 'internal': True }),
|
167
|
|
-# 'date_create': DataField.from_name('datetime')(**{ 'internal': True, 'now_on_create': True })})
|
168
|
|
-# Publication._child_classes = tuple()
|
169
|
|
-#
|
170
|
|
-# #List of dynamically generated classes
|
171
|
|
-# dynclasses = [Abstract_Object, User, Object, Entry, Entitie, Person, Indexabs, Text, Publication, Collection, Indextheme, Text_Person, Section, Subsection]
|
172
|
|
-# #Dict of dynamically generated classes indexed by name
|
173
|
|
-# dynclasses_dict = {'Abstract_Object': Abstract_Object, 'User': User, 'Object': Object, 'Entry': Entry, 'Entitie': Entitie, 'Person': Person, 'Indexabs': Indexabs, 'Text': Text, 'Publication': Publication, 'Collection': Collection, 'Indextheme': Indextheme, 'Text_Person': Text_Person, 'Section': Section, 'Subsection': Subsection}
|
174
|
|
-#
|
175
|
|
-#
|
176
|
|
-# ##@brief Return a dynamically generated class given it's name
|
177
|
|
-# #@param name str : The dynamic class name
|
178
|
|
-# #@return False or a child class of LeObject
|
179
|
|
-# def name2class(name):
|
180
|
|
-# if name not in dynclasses_dict:
|
181
|
|
-# return False
|
182
|
|
-# return dynclasses_dict[name]
|
183
|
|
-#
|
184
|
|
-#
|
185
|
|
-# ##@brief Return a dynamically generated class given it's name
|
186
|
|
-# #@note Case insensitive version of name2class
|
187
|
|
-# #@param name str
|
188
|
|
-# #@retrun False or a child class of LeObject
|
189
|
|
-# def lowername2class(name):
|
190
|
|
-# name = name.lower()
|
191
|
|
-# new_dict = {k.lower():v for k,v in dynclasses_dict.items()}
|
192
|
|
-# if name not in new_dict:
|
193
|
|
-# return False
|
194
|
|
-# return new_dict[name]
|
195
|
|
-#
|
196
|
|
-#
|
197
|
|
-# ##@brief Trigger dynclasses datasources initialisation
|
198
|
|
-# @LodelHook("lodel2_plugins_loaded")
|
199
|
|
-# def lodel2_dyncode_datasources_init(self, caller, payload):
|
200
|
|
-# for cls in dynclasses:
|
201
|
|
-# cls._init_datasources()
|
202
|
|
-# from lodel.plugin.hooks import LodelHook
|
203
|
|
-# LodelHook.call_hook("lodel2_dyncode_loaded", __name__, dynclasses)
|
204
|
|
-#
|
205
|
|
-#
|
206
|
|
-#
|
|
204
|
+# LodelHook.call_hook("lodel2_dyncode_loaded", __name__, dynclasses)
|
207
|
205
|
#</pre>
|
208
|
206
|
#
|