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
43f31c03
Commit
43f31c03
authored
Mar 05, 2015
by
PkSM3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUG] some problem with Cache and ResourceType
parent
11a413f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
3 deletions
+6
-3
settings.py
gargantext_web/settings.py
+1
-1
views_optimized.py
gargantext_web/views_optimized.py
+4
-1
corpustools.py
parsing/corpustools.py
+0
-1
project.html
templates/project.html
+1
-0
No files found.
gargantext_web/settings.py
View file @
43f31c03
...
@@ -93,7 +93,7 @@ WSGI_APPLICATION = 'wsgi.application'
...
@@ -93,7 +93,7 @@ WSGI_APPLICATION = 'wsgi.application'
DATABASES
=
{
DATABASES
=
{
'default'
:
{
'default'
:
{
'ENGINE'
:
'django.db.backends.postgresql_psycopg2'
,
'ENGINE'
:
'django.db.backends.postgresql_psycopg2'
,
'NAME'
:
'gargandb'
,
'NAME'
:
'
clone_
gargandb'
,
'USER'
:
'alexandre'
,
'USER'
:
'alexandre'
,
'PASSWORD'
:
'C8kdcUrAQy66U'
,
'PASSWORD'
:
'C8kdcUrAQy66U'
,
#'USER': 'gargantext',
#'USER': 'gargantext',
...
...
gargantext_web/views_optimized.py
View file @
43f31c03
...
@@ -87,7 +87,8 @@ def project(request, project_id):
...
@@ -87,7 +87,8 @@ def project(request, project_id):
# extract information from the form
# extract information from the form
name
=
form
.
cleaned_data
[
'name'
]
name
=
form
.
cleaned_data
[
'name'
]
thefile
=
form
.
cleaned_data
[
'file'
]
thefile
=
form
.
cleaned_data
[
'file'
]
resourcetype
=
cache
.
ResourceType
[
form
.
cleaned_data
[
'type'
]]
print
(
"thetype:"
,
form
.
cleaned_data
[
'type'
])
# <-- e.g: im receiving "isi"
resourcetype
=
cache
.
ResourceType
[
form
.
cleaned_data
[
'type'
]]
# e.g: here it converts to "pubmed" idk why
# which default language shall be used?
# which default language shall be used?
if
resourcetype
.
name
==
"europress_french"
:
if
resourcetype
.
name
==
"europress_french"
:
language_id
=
cache
.
Language
[
'fr'
]
.
id
language_id
=
cache
.
Language
[
'fr'
]
.
id
...
@@ -96,6 +97,8 @@ def project(request, project_id):
...
@@ -96,6 +97,8 @@ def project(request, project_id):
else
:
else
:
language_id
=
None
language_id
=
None
# corpus node instanciation as a Django model
# corpus node instanciation as a Django model
print
(
"name:"
,
name
)
print
(
"resourcetype.name:"
,
resourcetype
.
name
)
corpus
=
Node
(
corpus
=
Node
(
name
=
name
,
name
=
name
,
user_id
=
request
.
user
.
id
,
user_id
=
request
.
user
.
id
,
...
...
parsing/corpustools.py
View file @
43f31c03
...
@@ -195,7 +195,6 @@ class NgramsExtractors(defaultdict):
...
@@ -195,7 +195,6 @@ class NgramsExtractors(defaultdict):
ngramsextractors
=
NgramsExtractors
()
ngramsextractors
=
NgramsExtractors
()
def
extract_ngrams
(
corpus
,
keys
):
def
extract_ngrams
(
corpus
,
keys
):
print
(
"yoloo"
)
dbg
=
DebugTime
(
'Corpus #
%
d - ngrams'
%
corpus
.
id
)
dbg
=
DebugTime
(
'Corpus #
%
d - ngrams'
%
corpus
.
id
)
default_language_iso2
=
None
if
corpus
.
language_id
is
None
else
cache
.
Language
[
corpus
.
language_id
]
.
iso2
default_language_iso2
=
None
if
corpus
.
language_id
is
None
else
cache
.
Language
[
corpus
.
language_id
]
.
iso2
# query the metadata associated with the given keys
# query the metadata associated with the given keys
...
...
templates/project.html
View file @
43f31c03
...
@@ -290,6 +290,7 @@
...
@@ -290,6 +290,7 @@
var
typefield
=
$
(
"#id_type"
).
val
()
!=
""
var
typefield
=
$
(
"#id_type"
).
val
()
!=
""
var
filefield
=
$
(
"#id_file"
).
val
()
!=
""
var
filefield
=
$
(
"#id_file"
).
val
()
!=
""
if
(
namefield
&&
typefield
&&
filefield
)
{
if
(
namefield
&&
typefield
&&
filefield
)
{
alert
(
typefield
)
$
(
"#simpleloader"
).
html
(
'<img width="30px" src="{% static "js/libs/img2/loading-bar.gif" %}"></img>'
)
$
(
"#simpleloader"
).
html
(
'<img width="30px" src="{% static "js/libs/img2/loading-bar.gif" %}"></img>'
)
$
(
"#submit_thing"
).
prop
(
'onclick'
,
null
);
$
(
"#submit_thing"
).
prop
(
'onclick'
,
null
);
$
(
"#id_form"
).
submit
();
$
(
"#id_form"
).
submit
();
...
...
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