Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd8e44ab

Browse files
committed
fix json response structure to be same as original apijson api (java); because api changed, version restart with 0.2.0
1 parent609dff7 commitd8e44ab

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

‎uliweb_apijson/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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'

‎uliweb_apijson/apijson/templates/vue/inc_apijson_table.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
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
}
@@ -194,6 +194,10 @@
194194
thisp.loading=false
195195
if(data.code==200){
196196
vararr=data["[]"]
197+
for(vari=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
@@ -210,6 +214,7 @@
210214
varcol={title:k,key:k}
211215
if(typeofitem[k]==="boolean"){
212216
col["width"]=80
217+
col["component"]="checkbox"
213218
}
214219
elseif(typeofitem[k]==="number"){
215220
col["width"]=100

‎uliweb_apijson/apijson/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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
ifsecret_fields:
242243
forkinsecret_fields:
@@ -246,7 +247,8 @@ def _get_info(i):
246247
forkinkeys:
247248
ifknotinmodel_column_set:
248249
deld[k]
249-
returnd
250+
resultd[model_name]=d
251+
returnresultd
250252
l= [_get_info(i)foriinq]
251253
self.rdict[key]=l
252254

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp