Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Coughlin
GraceDB Server
Commits
d91e4e26
Commit
d91e4e26
authored
13 years ago
by
Brian Moe
Browse files
Options
Downloads
Patches
Plain Diff
Removed old UID and ligolw references in models.
parent
41f512e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/models.py
+5
-14
5 additions, 14 deletions
gracedb/models.py
with
5 additions
and
14 deletions
gracedb/models.py
+
5
−
14
View file @
d91e4e26
...
...
@@ -5,7 +5,6 @@ import string
import
os
from
gracedb.ligolw.models
import
CoincEvent
from
gracedb.utils
import
posixToGpsTime
from
django.conf
import
settings
...
...
@@ -60,12 +59,12 @@ class Event(models.Model):
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
group
=
models
.
ForeignKey
(
Group
)
analysisType
=
models
.
CharField
(
max_length
=
20
,
choices
=
ANALYSIS_TYPE_CHOICES
)
# From ligolw coinc_event table -- none are required. yet.
# from coinc_event
instruments
=
models
.
CharField
(
max_length
=
20
,
default
=
""
)
nevents
=
models
.
PositiveIntegerField
(
null
=
True
)
far
=
models
.
FloatField
(
null
=
True
)
likelihood
=
models
.
FloatField
(
null
=
True
)
coincEvent
=
models
.
ForeignKey
(
CoincEvent
,
null
=
True
)
# NOT from coinc_event, but so, so common.
# Note that the semantics for this is different depending
...
...
@@ -73,20 +72,13 @@ class Event(models.Model):
# be considered, umm, wrong? But it is a starting point.
gpstime
=
models
.
PositiveIntegerField
(
null
=
True
)
# XXX Deprecated. Only useful for old test data.
# Remove this when it won't freak people out to lose
# old date encoded uids.
uid
=
models
.
CharField
(
max_length
=
20
,
unique
=
False
,
default
=
""
)
labels
=
models
.
ManyToManyField
(
Label
,
through
=
"
Labelling
"
)
class
Meta
:
ordering
=
[
"
-id
"
]
def
graceid
(
self
):
if
self
.
uid
:
return
self
.
uid
elif
self
.
group
.
name
==
"
Test
"
:
if
self
.
group
.
name
==
"
Test
"
:
return
"
T%04d
"
%
self
.
id
elif
self
.
analysisType
==
"
HWINJ
"
:
return
"
H%04d
"
%
self
.
id
...
...
@@ -138,14 +130,13 @@ class Event(models.Model):
@classmethod
def
getByGraceid
(
cls
,
id
):
if
id
[
0
]
not
in
"
GHT
"
:
# Very old, probably useless data.
return
cls
.
objects
.
get
(
uid
=
id
)
e
=
cls
.
objects
.
get
(
id
=
int
(
id
[
1
:]))
if
(
id
[
0
]
==
"
T
"
)
and
(
e
.
group
.
name
!=
"
Test
"
):
raise
cls
.
DoesNotExist
()
if
(
id
[
0
]
==
"
H
"
)
and
(
e
.
analysisType
==
"
HWINJ
"
):
raise
cls
.
DoesNotExist
()
if
(
id
[
0
]
!=
"
G
"
):
raise
cls
.
DoesNotExist
()
return
e
def
__unicode__
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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