Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
64603ba9
Commit
64603ba9
authored
Mar 20, 2015
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Node_delete ok.
parent
b7ed74a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
views.py
gargantext_web/views.py
+15
-10
No files found.
gargantext_web/views.py
View file @
64603ba9
from
django.shortcuts
import
redirect
from
django.shortcuts
import
render
from
django.db
import
transaction
from
django.http
import
Http404
,
HttpResponse
,
HttpResponseRedirect
from
django.template.loader
import
get_template
...
...
@@ -458,11 +459,14 @@ def delete_node(request, node_id):
# session.delete(node)
# session.commit()
node
=
models
.
Node
.
get
(
id
=
node_id
)
node
.
delete
()
#children.all().delete()
node
=
models
.
Node
.
objects
.
get
(
id
=
node_id
)
with
transaction
.
atomic
():
try
:
node
.
children
.
delete
()
except
Exception
as
error
:
print
(
error
)
node
.
delete
()
if
node
.
type_id
==
cache
.
NodeType
[
'Project'
]
.
id
:
return
HttpResponseRedirect
(
'/projects/'
)
...
...
@@ -472,12 +476,13 @@ def delete_node(request, node_id):
def
delete_corpus
(
request
,
project_id
,
node_id
):
# ORM Django
node
=
models
.
Node
.
objects
.
get
(
id
=
node_id
)
try
:
node
.
children
.
delete
()
except
Exception
as
error
:
print
(
error
)
node
.
delete
()
with
transaction
.
atomic
():
node
=
models
.
Node
.
objects
.
get
(
id
=
node_id
)
try
:
node
.
children
.
delete
()
except
Exception
as
error
:
print
(
error
)
node
.
delete
()
# SQLA Django
# node = session.query(Node).filter(Node.id == node_id).first()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment