|
@@ -1,6 +1,7 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
2
|
2
|
from ...exceptions import *
|
3
|
3
|
from .base import get_response
|
|
4
|
+from .utils import *
|
4
|
5
|
|
5
|
6
|
from lodel.context import LodelContext
|
6
|
7
|
LodelContext.expose_modules(globals(), {
|
|
@@ -37,7 +38,6 @@ def admin_update(request):
|
37
|
38
|
# temporary, the acl will be more restrictive
|
38
|
39
|
#if WebUiClient.is_anonymous():
|
39
|
40
|
# return get_response('users/signin.html')
|
40
|
|
- msg=''
|
41
|
41
|
|
42
|
42
|
datas = process_form(request)
|
43
|
43
|
if not(datas is False):
|
|
@@ -113,6 +113,10 @@ def admin_create(request):
|
113
|
113
|
if 'lodel_id' in datas:
|
114
|
114
|
raise HttpException(400)
|
115
|
115
|
try:
|
|
116
|
+ for fld in datas:
|
|
117
|
+ if fld.endswith('[]'):
|
|
118
|
+ datas[fld[:-2]] = ','.join(datas[fld])
|
|
119
|
+ del datas[fld]
|
116
|
120
|
new_uid = target_leo.insert(
|
117
|
121
|
{ f:datas[f] for f in datas if f != 'classname'})
|
118
|
122
|
except LeApiDataCheckErrors as e:
|
|
@@ -139,7 +143,7 @@ def admin_create(request):
|
139
|
143
|
|
140
|
144
|
if classname is None or target_leo.is_abstract():
|
141
|
145
|
raise HttpException(400)
|
142
|
|
- return get_response('admin/admin_create.html', target=target_leo)
|
|
146
|
+ return get_response('admin/admin_create.html', target=target_leo, get_dataobjects=get_dataobjects)
|
143
|
147
|
|
144
|
148
|
##@brief Controller's function to delete an object of the editorial model
|
145
|
149
|
# @param request : the request (get)
|