|
@@ -288,5 +288,55 @@ text.new_field( 'linked_persons',
|
288
|
288
|
group = editorial_person_group,
|
289
|
289
|
)
|
290
|
290
|
|
|
291
|
+#####################
|
|
292
|
+# Index classes # <--- Note : using a different datasource for testing
|
|
293
|
+##################### purpose
|
|
294
|
+
|
|
295
|
+index_group = em.new_group( 'index_group',
|
|
296
|
+ display_name = 'Indexes',
|
|
297
|
+ help_text = {
|
|
298
|
+ 'eng': 'EM class that represents indexes'},
|
|
299
|
+ depends = (editorial_group,))
|
|
300
|
+
|
|
301
|
+index_abstract = em.new_class(
|
|
302
|
+ 'indexAbs',
|
|
303
|
+ display_name = {'eng': 'Abstract Index'},
|
|
304
|
+ help_text = {'eng': 'Abstract class common to each Index classes'},
|
|
305
|
+ abstract = True,
|
|
306
|
+ group = index_group,
|
|
307
|
+ datasource = 'dummy2',
|
|
308
|
+ parents = em_object)
|
|
309
|
+
|
|
310
|
+index_name = index_abstract.new_field(
|
|
311
|
+ 'name',
|
|
312
|
+ display_name = {
|
|
313
|
+ 'eng': 'name',
|
|
314
|
+ 'fre': 'nom'},
|
|
315
|
+ data_handler = 'varchar')
|
|
316
|
+
|
|
317
|
+index_value = index_abstract.new_field(
|
|
318
|
+ 'value',
|
|
319
|
+ display_name = {
|
|
320
|
+ 'eng': 'value',
|
|
321
|
+ 'fre': 'valeur'},
|
|
322
|
+ data_handler = 'varchar')
|
|
323
|
+
|
|
324
|
+index_theme = em.new_class(
|
|
325
|
+ 'indexTheme',
|
|
326
|
+ display_name = {
|
|
327
|
+ 'eng': 'Thematic index',
|
|
328
|
+ 'fre': 'Index thématique'},
|
|
329
|
+ group = index_group,
|
|
330
|
+ datasource = 'dummy2',
|
|
331
|
+ parents = index_abstract)
|
|
332
|
+
|
|
333
|
+index_theme_theme = index_abstract.new_field(
|
|
334
|
+ 'theme',
|
|
335
|
+ display_name = {
|
|
336
|
+ 'eng': 'theme'},
|
|
337
|
+ data_handler = 'varchar')
|
|
338
|
+
|
291
|
339
|
#em.save('xmlfile', filename = 'examples/em_test.xml')
|
292
|
|
-em.save('picklefile', filename = 'examples/em_test.pickle')
|
|
340
|
+pickle_file = 'examples/em_test.pickle'
|
|
341
|
+em.save('picklefile', filename = pickle_file)
|
|
342
|
+print("Output written in %s" % pickle_file)
|