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
7ed5bd85
Commit
7ed5bd85
authored
Oct 15, 2015
by
delanoe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Urls and views cleaned.
parent
8dca1faa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
26 deletions
+0
-26
urls.py
annotations/urls.py
+0
-1
views.py
annotations/views.py
+0
-25
No files found.
annotations/urls.py
View file @
7ed5bd85
...
@@ -7,5 +7,4 @@ urlpatterns = patterns('',
...
@@ -7,5 +7,4 @@ urlpatterns = patterns('',
url
(
r'^corpus/(?P<corpus_id>[0-9]+)/document/(?P<doc_id>[0-9]+)$'
,
views
.
NgramList
.
as_view
()),
# the list associated with an ngram
url
(
r'^corpus/(?P<corpus_id>[0-9]+)/document/(?P<doc_id>[0-9]+)$'
,
views
.
NgramList
.
as_view
()),
# the list associated with an ngram
url
(
r'^lists/(?P<list_id>[0-9]+)/ngrams/(?P<ngram_ids>(([0-9])+(\+[0-9]+)*)$'
,
views
.
NgramEdit
.
as_view
()),
#
url
(
r'^lists/(?P<list_id>[0-9]+)/ngrams/(?P<ngram_ids>(([0-9])+(\+[0-9]+)*)$'
,
views
.
NgramEdit
.
as_view
()),
#
url
(
r'^lists/(?P<list_id>[0-9]+)/ngrams/create$'
,
views
.
NgramCreate
.
as_view
()),
#
url
(
r'^lists/(?P<list_id>[0-9]+)/ngrams/create$'
,
views
.
NgramCreate
.
as_view
()),
#
url
(
r'^lists/(?P<list_id>[0-9]+)/multiple?$'
,
views
.
deleteMultiple
),
# FIXME What's this ?
)
)
annotations/views.py
View file @
7ed5bd85
...
@@ -15,7 +15,6 @@ from rest_framework.authentication import SessionAuthentication, BasicAuthentica
...
@@ -15,7 +15,6 @@ from rest_framework.authentication import SessionAuthentication, BasicAuthentica
from
node.models
import
Node
from
node.models
import
Node
from
gargantext_web.db
import
*
from
gargantext_web.db
import
*
from
ngram.lists
import
listIds
,
listNgramIds
from
ngram.lists
import
listIds
,
listNgramIds
from
rest_v1_0.api
import
JsonHttpResponse
@
login_required
@
login_required
...
@@ -142,30 +141,6 @@ class NgramCreate(APIView):
...
@@ -142,30 +141,6 @@ class NgramCreate(APIView):
'list_id'
:
list_id
,
'list_id'
:
list_id
,
})
})
def
deleteMultiple
(
request
,
list_id
):
results
=
[
"hola"
,
"mundo"
]
user
=
request
.
user
if
not
user
.
is_authenticated
():
return
redirect
(
'/login/?next=
%
s'
%
request
.
path
)
if
request
.
POST
:
todel_ids
=
json
.
loads
(
request
.
POST
[
'to_delete'
])
for
ngram_id
in
todel_ids
:
# add the ngram to the list if not already done
node_ngram
=
(
session
.
query
(
Node_Ngram
)
.
filter
(
Node_Ngram
.
node_id
==
list_id
)
.
filter
(
Node_Ngram
.
ngram_id
==
ngram_id
)
.
first
()
)
if
node_ngram
is
None
:
node_ngram
=
Node_Ngram
(
node_id
=
list_id
,
ngram_id
=
ngram_id
,
weight
=
1.0
)
session
.
add
(
node_ngram
)
session
.
commit
()
return
JsonHttpResponse
(
results
)
class
Document
(
APIView
):
class
Document
(
APIView
):
"""
"""
...
...
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