Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ippidb-web
Manage
Activity
Members
Labels
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iPPIDB
ippidb-web
Commits
7a90f0c2
Commit
7a90f0c2
authored
7 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
correct AutoFillableModel save() method
Former-commit-id: 12c1287962b7745bd096b3988ea9d663cdb6e050
parent
63675775
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ippisite/ippidb/models.py
+6
-3
6 additions, 3 deletions
ippisite/ippidb/models.py
with
6 additions
and
3 deletions
ippisite/ippidb/models.py
+
6
−
3
View file @
7a90f0c2
...
...
@@ -18,7 +18,9 @@ class AutoFillableModel(models.Model):
def
save
(
self
,
*
args
,
**
kwargs
):
if
kwargs
.
get
(
'
autofill
'
)
is
True
:
self
.
autofill
()
super
(
AutoFillableModel
,
self
).
save
(
*
args
,
**
kwargs
)
if
'
autofill
'
in
kwargs
:
del
kwargs
[
'
autofill
'
]
super
(
AutoFillableModel
,
self
).
save
(
*
args
,
*
kwargs
)
class
Bibliography
(
AutoFillableModel
):
...
...
@@ -30,7 +32,7 @@ class Bibliography(AutoFillableModel):
(
'
PT
'
,
'
Patent
'
),
(
'
DO
'
,
'
DOI ID
'
)
)
source
=
models
.
CharField
(
'
Bibliographic type
'
,
max_length
=
2
,
choices
=
SOURCES
)
source
=
models
.
CharField
(
'
Bibliographic type
'
,
max_length
=
2
,
choices
=
SOURCES
,
default
=
'
PM
'
)
id_source
=
models
.
CharField
(
'
Bibliographic ID
'
,
max_length
=
25
)
title
=
models
.
CharField
(
'
Title
'
,
max_length
=
300
)
journal_name
=
models
.
CharField
(
'
Journal name
'
,
max_length
=
50
,
null
=
True
)
...
...
@@ -107,7 +109,8 @@ class Protein(AutoFillableModel):
taxonomy
.
taxonomy_id
=
info
[
'
organism
'
]
taxonomy
.
save
(
autofill
=
True
)
self
.
organism
=
taxonomy
#super(Protein, self).save(*args, **kwargs)
print
(
self
,
self
.
gene_name
)
super
(
Protein
,
self
).
save
()
for
go_id
in
info
[
'
molecular_functions
'
]:
try
:
mol_function
=
MolecularFunction
.
objects
.
get
(
go_id
=
go_id
)
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment