Selaa lähdekoodia

Some corrections for interface update object

prieto 8 vuotta sitten
vanhempi
commit
9769b873e9

+ 0
- 1
lodel/leapi/leobject.py Näytä tiedosto

@@ -599,7 +599,6 @@ construction and consitency when datas are not complete\n")
599 599
         query_filter = list()
600 600
         for uid in uids:
601 601
             query_filter.append((uid, '=', self.data(uid)))
602
-        
603 602
         try:
604 603
             query = LeUpdateQuery(self.__class__, query_filter)
605 604
         except Exception as err:

+ 6
- 9
plugins/webui/interface/controllers/admin.py Näytä tiedosto

@@ -5,12 +5,15 @@ from lodel.leapi.exceptions import *
5 5
 from lodel import logger
6 6
 
7 7
 import leapi_dyncode as dyncode
8
+import warnings
9
+from lodel import logger
8 10
 
9 11
 def index_admin(request):
10 12
     return get_response('admin/admin.html')
11 13
 
12 14
 def admin_update(request):
13 15
     if request.method == 'POST':
16
+
14 17
         error = None
15 18
         datas = list()
16 19
         classname = request.form['classname']
@@ -60,10 +63,8 @@ def admin_update(request):
60 63
             target_leo = dyncode.Object.name2class(classname)
61 64
         except LeApiError:
62 65
             classname = None
63
-    template_vars = {
64
-        'params': request.GET
65
-    }
66
-    return get_response('admin/admin_edit.html', target=target_leo, lodel_id =lodel_id, tpl_vars=template_vars)
66
+
67
+    return get_response('admin/admin_edit.html', target=target_leo, lodel_id =lodel_id)
67 68
 
68 69
 def admin_create(request):
69 70
     classname = None
@@ -106,11 +107,7 @@ def admin_create(request):
106 107
         msg = request.GET['msg']
107 108
     if classname is None or target_leo.is_abstract():
108 109
         raise HttpException(400)
109
-    template_vars = {
110
-        'params': request.GET,
111
-        'msg' : msg
112
-    }
113
-    return get_response('admin/admin_create.html', tpl_vars=template_vars, target=target_leo)
110
+    return get_response('admin/admin_create.html', target=target_leo)
114 111
 
115 112
 def admin(request):
116 113
     return get_response('admin/admin.html')

+ 3
- 0
plugins/webui/templates/admin/admin_edit.html Näytä tiedosto

@@ -4,6 +4,9 @@
4 4
 {% set obj = objects.pop() %}
5 5
 {% block title %}- Edit Object{% endblock %}
6 6
 {% block body %}
7
+{% if msg is not none %}
8
+{% block msg %} <p style="color:red; font-size:20pt; font-weight:bold">{{ msg }}</p> {% endblock %}
9
+{% endif %}
7 10
 <h1>Lodel 2 - Edit Object {{ lodel_id }} of {{ target.__name__ }}</h1>
8 11
     <form action="" method ="post">
9 12
     <input type="hidden" name="uid" value="{{ lodel_id}}" >

Loading…
Peruuta
Tallenna