Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
ba5be5a5
Commit
ba5be5a5
authored
Mar 23, 2017
by
Hervé MENAGER
Browse files
retrieve info from NCBI for Taxonomy class
parent
b8fc24ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
ippisite/ippidb/models.py
View file @
ba5be5a5
...
...
@@ -52,6 +52,12 @@ class BibliographyForm(ModelForm):
class
Taxonomy
(
models
.
Model
):
taxonomy_id
=
models
.
DecimalField
(
'NCBI TaxID'
,
unique
=
True
,
max_digits
=
9
,
decimal_places
=
0
)
name
=
models
.
CharField
(
'Organism name'
,
max_length
=
200
)
def
save
(
self
,
*
args
,
**
kwargs
):
info
=
get_taxonomy_info
(
self
.
taxonomy_id
)
self
.
name
=
info
[
'scientific_name'
]
super
(
Taxonomy
,
self
).
save
(
*
args
,
**
kwargs
)
class
Meta
:
verbose_name_plural
=
"taxonomies"
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment