Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
plugin_dbui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2pext
plugin_dbui
Commits
5dd562c1
Commit
5dd562c1
authored
8 years ago
by
LE GAC Renaud
Browse files
Options
Downloads
Patches
Plain Diff
Simplify the proxy Direct.js by using request.jsonData.
parent
a280c1ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!27
Release 0.9.1
,
!26
8 extjs 6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/plugin_dbui/dbsvc.py
+4
-2
4 additions, 2 deletions
modules/plugin_dbui/dbsvc.py
static/plugin_dbui/src/data/proxy/Direct.js
+6
-24
6 additions, 24 deletions
static/plugin_dbui/src/data/proxy/Direct.js
with
10 additions
and
26 deletions
modules/plugin_dbui/dbsvc.py
+
4
−
2
View file @
5dd562c1
...
...
@@ -472,7 +472,8 @@ class DbSvc(BaseSvc):
table
=
db
[
tablename
]
# Abort the transaction is at least one record does not exists
for
rec_id
in
arg
[
ROOT
]:
for
record
in
arg
[
ROOT
]:
rec_id
=
record
[
table_id
]
if
not
table
[
rec_id
]:
otd
=
{
"
success
"
:
False
,
"
errors
"
:
RECORD_NOT_IN_DB
%
(
rec_id
,
tablename
),
...
...
@@ -480,7 +481,8 @@ class DbSvc(BaseSvc):
return
otd
# delete records
for
rec_id
in
arg
[
ROOT
]:
for
record
in
arg
[
ROOT
]:
rec_id
=
record
[
table_id
]
try
:
rep
=
db
(
table
.
id
==
rec_id
).
delete
()
...
...
This diff is collapsed.
Click to expand it.
static/plugin_dbui/src/data/proxy/Direct.js
+
6
−
24
View file @
5dd562c1
...
...
@@ -83,8 +83,7 @@ Ext.define('Dbui.data.proxy.Direct', {
"
use strict
"
;
var
me
=
this
,
action
,
api
,
args
,
data
,
fieldId
,
i
,
fn
,
params
,
records
,
request
,
writer
;
action
,
api
,
args
,
fieldId
,
i
,
fn
,
params
,
request
,
writer
;
if
(
!
me
.
methodsResolved
)
{
me
.
resolveMethods
();
...
...
@@ -116,35 +115,18 @@ Ext.define('Dbui.data.proxy.Direct', {
case
'
create
'
:
fieldId
=
Dbui
.
encodeField
(
params
.
tableName
,
'
id
'
);
params
.
records
=
[];
records
=
request
.
getRecords
();
for
(
i
=
0
;
i
<
records
.
length
;
i
+=
1
)
{
data
=
records
[
i
].
getData
();
delete
data
[
fieldId
];
params
.
records
.
push
(
data
);
params
.
records
=
request
.
getJsonData
();
for
(
i
=
0
;
i
<
params
.
records
.
length
;
i
+=
1
)
{
delete
params
.
records
[
i
][
fieldId
];
}
break
;
case
'
update
'
:
params
.
records
=
[];
records
=
request
.
getRecords
();
for
(
i
=
0
;
i
<
records
.
length
;
i
+=
1
)
{
data
=
records
[
i
].
getData
();
params
.
records
.
push
(
data
);
}
params
.
records
=
request
.
getJsonData
();
break
;
case
'
destroy
'
:
fieldId
=
Dbui
.
encodeField
(
params
.
tableName
,
'
id
'
);
params
.
records
=
[];
records
=
request
.
getRecords
();
for
(
i
=
0
;
i
<
records
.
length
;
i
+=
1
)
{
data
=
records
[
i
].
getData
();
params
.
records
.
push
(
data
[
fieldId
]);
}
params
.
records
=
request
.
getJsonData
();
break
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment