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
1ed99fcc
Commit
1ed99fcc
authored
Jul 27, 2016
by
c24b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RESOURCE ADD CORPUS FORM mapping resource[type] > Parser
parent
eb08fe7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
constants.py
gargantext/constants.py
+1
-1
projects.py
gargantext/views/pages/projects.py
+5
-1
No files found.
gargantext/constants.py
View file @
1ed99fcc
...
...
@@ -161,7 +161,7 @@ RESOURCETYPES = [
'default_languages'
:
[
'en'
],
},
{
'type'
:
3
,
'name'
:
'Pubmed'
,
'name'
:
'Pubmed
[XML]
'
,
'format'
:
'Pubmed'
,
'parser'
:
"PubmedParser"
,
'file_formats'
:[
"zip"
,
"xml"
],
...
...
gargantext/views/pages/projects.py
View file @
1ed99fcc
...
...
@@ -59,12 +59,16 @@ def overview(request):
class
NewCorpusForm
(
forms
.
Form
):
#mapping choices based on ressource.type
type
=
forms
.
ChoiceField
(
choices
=
enumerate
(
resource_type
[
'name'
]
for
resource_type
in
RESOURCETYPES
)
,
choices
=
[(
resource
[
"type"
],
resource
[
"name"
])
for
resource
in
RESOURCETYPES
]
,
widget
=
forms
.
Select
(
attrs
=
{
'onchange'
:
'CustomForSelect( $("option:selected", this).text() );'
})
)
name
=
forms
.
CharField
(
label
=
'Name'
,
max_length
=
199
,
widget
=
forms
.
TextInput
(
attrs
=
{
'required'
:
'true'
}))
file
=
forms
.
FileField
()
def
clean_resource
(
self
):
file_
=
self
.
cleaned_data
.
get
(
'file'
)
def
clean_file
(
self
):
file_
=
self
.
cleaned_data
.
get
(
'file'
)
if
len
(
file_
)
>
1024
**
3
:
# we don't accept more than 1GB
...
...
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