Browse Source

Fixes scripts & em_tests (bugs with settings bootstrap)

Yann Weber 8 years ago
parent
commit
54493b4538
4 changed files with 11 additions and 2 deletions
  1. 3
    2
      em_test.py
  2. BIN
      examples/em_test.pickle
  3. 7
    0
      loader.py
  4. 1
    0
      scripts/admin.py

+ 3
- 2
em_test.py View File

@@ -1,5 +1,6 @@
1 1
 #-*- coding: utf-8 -*-
2 2
 
3
+import loader
3 4
 from lodel.editorial_model.components import *
4 5
 from lodel.editorial_model.exceptions import *
5 6
 from lodel.editorial_model.model import EditorialModel
@@ -170,7 +171,7 @@ collection.new_field(   'publications',
170 171
                         back_reference = ('publication', 'collection'))
171 172
 
172 173
 # Classe publication
173
-pulication = em.new_class(  'publication',
174
+publication = em.new_class(  'publication',
174 175
                             display_name = 'Publication',
175 176
                             group = editorial_group,
176 177
                             abstract = False,
@@ -200,7 +201,7 @@ subsection = em.new_class(  'subsection',
200 201
 section.new_field(  'childs',
201 202
                     display_name = 'Next section',
202 203
                     group = editorial_group,
203
-                    data_hander = 'hierarch',
204
+                    data_handler = 'hierarch',
204 205
                     allowed_class = [subsection],
205 206
                     back_reference = ('subsection', 'parent'))
206 207
 

BIN
examples/em_test.pickle View File


+ 7
- 0
loader.py View File

@@ -0,0 +1,7 @@
1
+#-*- coding: utf-8 -*-
2
+
3
+import imp
4
+import lodel.settings
5
+from lodel.settings.settings import Settings
6
+Settings.bootstrap(conf_file = 'settings_local.ini', conf_dir = 'globconf.d')
7
+imp.reload(lodel.settings)

+ 1
- 0
scripts/admin.py View File

@@ -4,6 +4,7 @@ import sys
4 4
 import os, os.path
5 5
 
6 6
 sys.path.append(os.path.dirname(os.getcwd()+'/..'))
7
+import loader
7 8
 
8 9
 def generate_dyncode(model_file, translator):
9 10
     from lodel.editorial_model.model import EditorialModel

Loading…
Cancel
Save