File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1- __version__ = '0.1.4 '
1+ __version__ = '0.2.0 '
22__url__ = 'https://github.com/zhangchunlin/uliweb-apijson'
33__author__ = 'Chunlin Zhang'
44__email__ = 'zhangchunlin@gmail.com'
Original file line number Diff line number Diff line change 175175 "@page" :thisp . current_page - 1 ,
176176 "@query" :2
177177 }
178- arr_params [ this . model_name ] = {
178+ arr_params [ thisp . model_name ] = {
179179 "@order" :thisp . sort_key + thisp . sort_order ,
180180 "@role" :"{{=role}}"
181181 }
194194 thisp . loading = false
195195 if ( data . code == 200 ) {
196196 var arr = data [ "[]" ]
197+ for ( var i = 0 ; i < arr . length ; i ++ ) {
198+ arr [ i ] = arr [ i ] [ thisp . model_name ]
199+ }
200+
197201 if ( ! thisp . tcolumns_init ) {
198202 if ( thisp . config_table_fields != null ) {
199203 thisp . tcolumns = thisp . config_table_fields
210214 var col = { title :k , key :k }
211215 if ( typeof item [ k ] === "boolean" ) {
212216 col [ "width" ] = 80
217+ col [ "component" ] = "checkbox"
213218 }
214219 else if ( typeof item [ k ] === "number" ) {
215220 col [ "width" ] = 100
Original file line number Diff line number Diff line change @@ -237,6 +237,7 @@ def _get_array(self,key):
237237 q = q .order_by (getattr (column ,sort_order )())
238238
239239 def _get_info (i ):
240+ resultd = {}
240241 d = i .to_dict ()
241242 if secret_fields :
242243 for k in secret_fields :
@@ -246,7 +247,8 @@ def _get_info(i):
246247 for k in keys :
247248 if k not in model_column_set :
248249 del d [k ]
249- return d
250+ resultd [model_name ] = d
251+ return resultd
250252 l = [_get_info (i ) for i in q ]
251253 self .rdict [key ] = l
252254
You can’t perform that action at this time.
0 commit comments