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
d7519b44
Commit
d7519b44
authored
7 years ago
by
Hervé MENAGER
Browse files
Options
Downloads
Patches
Plain Diff
remodel MDDR activity classes through a ManyToMany field
fixes #39
parent
075da751
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ippisite/db.sqlite3
+0
-0
0 additions, 0 deletions
ippisite/db.sqlite3
ippisite/ippidb/migrations/0018_auto_20170522_1501.py
+41
-0
41 additions, 0 deletions
ippisite/ippidb/migrations/0018_auto_20170522_1501.py
ippisite/ippidb/models.py
+10
-10
10 additions, 10 deletions
ippisite/ippidb/models.py
with
51 additions
and
10 deletions
ippisite/db.sqlite3
+
0
−
0
View file @
d7519b44
No preview for this file type
This diff is collapsed.
Click to expand it.
ippisite/ippidb/migrations/0018_auto_20170522_1501.py
0 → 100644
+
41
−
0
View file @
d7519b44
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-22 15:01
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
ippidb
'
,
'
0017_auto_20170519_1500
'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'
MDDRActivityClass
'
,
fields
=
[
(
'
id
'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'
ID
'
)),
(
'
activity_class
'
,
models
.
CharField
(
max_length
=
100
,
unique
=
True
,
verbose_name
=
'
Activity Class
'
)),
],
options
=
{
'
verbose_name_plural
'
:
'
MDDR activity classes
'
,
},
),
migrations
.
AlterUniqueTogether
(
name
=
'
mddrcompoundactivityclass
'
,
unique_together
=
set
([]),
),
migrations
.
RemoveField
(
model_name
=
'
mddrcompoundactivityclass
'
,
name
=
'
mddr_compound
'
,
),
migrations
.
DeleteModel
(
name
=
'
MDDRCompoundActivityClass
'
,
),
migrations
.
AddField
(
model_name
=
'
mddrcompoundimport
'
,
name
=
'
activity_classes
'
,
field
=
models
.
ManyToManyField
(
to
=
'
ippidb.MDDRActivityClass
'
),
),
]
This diff is collapsed.
Click to expand it.
ippisite/ippidb/models.py
+
10
−
10
View file @
d7519b44
...
@@ -243,6 +243,15 @@ class Compound(models.Model):
...
@@ -243,6 +243,15 @@ class Compound(models.Model):
mddr_compound
=
models
.
ForeignKey
(
'
MDDRCompoundImport
'
,
blank
=
True
,
null
=
True
)
mddr_compound
=
models
.
ForeignKey
(
'
MDDRCompoundImport
'
,
blank
=
True
,
null
=
True
)
class
MDDRActivityClass
(
models
.
Model
):
activity_class
=
models
.
CharField
(
'
Activity Class
'
,
max_length
=
100
,
unique
=
True
)
class
Meta
:
verbose_name_plural
=
"
MDDR activity classes
"
def
__str__
(
self
):
return
self
.
activity_class
class
MDDRCompoundImport
(
models
.
Model
):
class
MDDRCompoundImport
(
models
.
Model
):
mddr_compound_id
=
models
.
IntegerField
(
'
MDDR compound ID
'
)
mddr_compound_id
=
models
.
IntegerField
(
'
MDDR compound ID
'
)
mddr_name
=
models
.
CharField
(
'
MDDR name
'
,
max_length
=
40
)
mddr_name
=
models
.
CharField
(
'
MDDR name
'
,
max_length
=
40
)
...
@@ -250,6 +259,7 @@ class MDDRCompoundImport(models.Model):
...
@@ -250,6 +259,7 @@ class MDDRCompoundImport(models.Model):
canonical_smile
=
models
.
CharField
(
'
Canonical Smile
'
,
max_length
=
500
,
unique
=
True
,
blank
=
True
,
null
=
True
)
canonical_smile
=
models
.
CharField
(
'
Canonical Smile
'
,
max_length
=
500
,
unique
=
True
,
blank
=
True
,
null
=
True
)
#TODO index this table on canonical_smile
#TODO index this table on canonical_smile
db_import_date
=
models
.
DecimalField
(
'
MDDR release year/month
'
,
max_digits
=
6
,
decimal_places
=
0
)
db_import_date
=
models
.
DecimalField
(
'
MDDR release year/month
'
,
max_digits
=
6
,
decimal_places
=
0
)
activity_classes
=
models
.
ManyToManyField
(
MDDRActivityClass
)
class
Meta
:
class
Meta
:
# over multiple releases of the MDDR database, the same compound can evolve in its development phase
# over multiple releases of the MDDR database, the same compound can evolve in its development phase
...
@@ -257,16 +267,6 @@ class MDDRCompoundImport(models.Model):
...
@@ -257,16 +267,6 @@ class MDDRCompoundImport(models.Model):
unique_together
=
((
'
mddr_compound_id
'
,
'
mddr_name
'
,
'
dvpmt_phase
'
),)
unique_together
=
((
'
mddr_compound_id
'
,
'
mddr_name
'
,
'
dvpmt_phase
'
),)
verbose_name_plural
=
"
MDDR compound imports
"
verbose_name_plural
=
"
MDDR compound imports
"
class
MDDRCompoundActivityClass
(
models
.
Model
):
mddr_compound
=
models
.
ForeignKey
(
MDDRCompoundImport
)
activity_class
=
models
.
CharField
(
'
Activity Class
'
,
max_length
=
100
)
class
Meta
:
unique_together
=
((
'
mddr_compound
'
,
'
activity_class
'
),)
verbose_name_plural
=
"
MDDR compound activity classes
"
class
MDDRSimilarity
(
models
.
Model
):
class
MDDRSimilarity
(
models
.
Model
):
canonical_smile_ippidb
=
models
.
CharField
(
'
Canonical Smile for IPPIDB compound
'
,
max_length
=
500
,
unique
=
True
,
blank
=
True
,
null
=
True
)
canonical_smile_ippidb
=
models
.
CharField
(
'
Canonical Smile for IPPIDB compound
'
,
max_length
=
500
,
unique
=
True
,
blank
=
True
,
null
=
True
)
canonical_smile_mddr
=
models
.
CharField
(
'
Canonical Smile for MDDR Compound
'
,
max_length
=
500
,
unique
=
True
,
blank
=
True
,
null
=
True
)
canonical_smile_mddr
=
models
.
CharField
(
'
Canonical Smile for MDDR Compound
'
,
max_length
=
500
,
unique
=
True
,
blank
=
True
,
null
=
True
)
...
...
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