Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Duncan Macleod
gracedb
Commits
d4e80b0d
Commit
d4e80b0d
authored
Feb 20, 2015
by
Branson Craig Stephens
Browse files
Window-dressing changes for GlitchDB.
parent
937034fc
Changes
4
Hide whitespace changes
Inline
Side-by-side
ligoauth/migrations/0015_add_gstlal_user_and_dn.py
0 → 100644
View file @
d4e80b0d
# -*- coding: utf-8 -*-
import
datetime
from
south.db
import
db
from
south.v2
import
DataMigration
from
django.db
import
models
users
=
[
{
'username'
:
'gstlal-spiir'
,
'first_name'
:
''
,
'last_name'
:
'GSTLAL SPIIR Analysis'
,
'email'
:
'qi.chu@ligo.org'
,
'dns'
:
[
"/DC=org/DC=ligo/O=LIGO/OU=Services/CN=gstlal-spiir/ldas-pcdev1.ligo.caltech.edu"
,
]
},
]
class
Migration
(
DataMigration
):
def
forwards
(
self
,
orm
):
LocalUser
=
orm
[
'ligoauth.LocalUser'
]
X509Cert
=
orm
[
'ligoauth.X509Cert'
]
# Local Users
for
entry
in
users
:
user
,
created
=
LocalUser
.
objects
.
get_or_create
(
username
=
entry
[
'username'
])
if
created
:
user
.
first_name
=
entry
[
'first_name'
]
user
.
last_name
=
entry
[
'last_name'
]
user
.
email
=
entry
[
'email'
]
user
.
is_active
=
True
user
.
is_staff
=
False
user
.
is_superuser
=
False
user
.
save
()
current_dns
=
set
([
cert
.
subject
for
cert
in
user
.
x509cert_set
.
all
()])
new_dns
=
set
(
entry
[
'dns'
])
missing_dns
=
new_dns
-
current_dns
redundant_dns
=
current_dns
-
new_dns
for
dn
in
missing_dns
:
cert
,
created
=
X509Cert
.
objects
.
get_or_create
(
subject
=
dn
)
if
created
:
cert
.
save
()
cert
.
users
.
add
(
user
)
for
dn
in
redundant_dns
:
cert
=
X509Cert
.
objects
.
get
(
subject
=
dn
)
cert
.
users
.
remove
(
user
)
def
backwards
(
self
,
orm
):
LocalUser
=
orm
[
'ligoauth.LocalUser'
]
X509Cert
=
orm
[
'ligoauth.X509Cert'
]
for
entry
in
users
:
for
dn
in
entry
[
'dns'
]:
cert
=
X509Cert
.
objects
.
get
(
subject
=
dn
)
cert
.
delete
()
user
=
LocalUser
.
objects
.
get
(
username
=
entry
[
'username'
])
user
.
delete
()
models
=
{
'auth.group'
:
{
'Meta'
:
{
'object_name'
:
'Group'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'80'
}),
'permissions'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Permission']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
})
},
'auth.permission'
:
{
'Meta'
:
{
'ordering'
:
"('content_type__app_label', 'content_type__model', 'codename')"
,
'unique_together'
:
"(('content_type', 'codename'),)"
,
'object_name'
:
'Permission'
},
'codename'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'content_type'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['contenttypes.ContentType']"
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'50'
})
},
'auth.user'
:
{
'Meta'
:
{
'object_name'
:
'User'
},
'date_joined'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'email'
:
(
'django.db.models.fields.EmailField'
,
[],
{
'max_length'
:
'75'
,
'blank'
:
'True'
}),
'first_name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'30'
,
'blank'
:
'True'
}),
'groups'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Group']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'is_active'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'True'
}),
'is_staff'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'is_superuser'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'last_login'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'last_name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'30'
,
'blank'
:
'True'
}),
'password'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'128'
}),
'user_permissions'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Permission']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
}),
'username'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'30'
})
},
'contenttypes.contenttype'
:
{
'Meta'
:
{
'ordering'
:
"('name',)"
,
'unique_together'
:
"(('app_label', 'model'),)"
,
'object_name'
:
'ContentType'
,
'db_table'
:
"'django_content_type'"
},
'app_label'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'model'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
})
},
'ligoauth.ligoldapuser'
:
{
'Meta'
:
{
'object_name'
:
'LigoLdapUser'
,
'_ormbases'
:
[
'auth.User'
]},
'ldap_dn'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'100'
}),
'user_ptr'
:
(
'django.db.models.fields.related.OneToOneField'
,
[],
{
'to'
:
"orm['auth.User']"
,
'unique'
:
'True'
,
'primary_key'
:
'True'
})
},
'ligoauth.localuser'
:
{
'Meta'
:
{
'object_name'
:
'LocalUser'
,
'_ormbases'
:
[
'auth.User'
]},
'user_ptr'
:
(
'django.db.models.fields.related.OneToOneField'
,
[],
{
'to'
:
"orm['auth.User']"
,
'unique'
:
'True'
,
'primary_key'
:
'True'
})
},
'ligoauth.x509cert'
:
{
'Meta'
:
{
'object_name'
:
'X509Cert'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'subject'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'200'
}),
'users'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.User']"
,
'symmetrical'
:
'False'
})
}
}
complete_apps
=
[
'ligoauth'
]
symmetrical
=
True
templates/base.html
View file @
d4e80b0d
...
...
@@ -4,7 +4,7 @@
<head>
{% block headcontents %}
<link
rel=
"stylesheet"
href=
"{{STATIC_URL}}css/style.css"
/>
<title>
G
raceDb
| {% block title %}{% endblock %}
</title>
<title>
G
litchDD
| {% block title %}{% endblock %}
</title>
<!-- START TESTING -->
<script
type=
"text/javascript"
>
function
changeTime
(
obj
,
label
)
{
...
...
@@ -27,7 +27,7 @@ function changeTime(obj, label) {
<div
id=
"content"
>
<center>
<h1>
G
race
DB
—
G
ravitational Wave
Candidate Event Database
</h1>
<h1>
G
litch
DB
—
G
litch
Candidate Event Database
</h1>
</center>
{% block nav %}
...
...
@@ -51,9 +51,11 @@ function changeTime(obj, label) {
</ul>
<center>
{% if config_name %}
<!--
<h1 style="color: red;">
{{config_name}}
</h1>
-->
{% endif %}
</center>
{% endblock %}
...
...
templates/gracedb/index.html
View file @
d4e80b0d
{% extends "base.html" %}
{% block title %}Home{% endblock %}
{% block heading %}G
race
DB Overview{% endblock %}
{% block heading %}G
litch
DB Overview{% endblock %}
{% block pageid %}home{% endblock %}
{% block jscript %}
<style>
...
...
@@ -32,15 +32,14 @@
<div
class=
"text"
>
<p>
The g
ravitational-wave candidate event
database (G
race
DB) is a
prototype system to organize candidate
events from gravitational-wave
searches
and to provide an environment to record information about
follow-ups.
</p>
<p>
The g
litch
database (G
litch
DB) is a
prototype system to organize candidate
glitch events
and to provide an environment to record information about
follow-ups.
This project is based on
<a
href=
"https://gracedb.ligo.org"
>
GraceDB
</a>
.
</p>
<ul>
<li><a
href=
"https://www.lsc-group.phys.uwm.edu/daswg/wiki/GraceDBER6"
>
Recent changes
</a>
<font
color=
"red"
>
(IMPORTANT!)
</font></li>
<li><a
href=
"https://gw-astronomy.org/wiki/LV_EM/ElectroMagneticBulletinBoard"
>
Prototype EMBB description
</a></li>
<li><a
href=
"https://www.lsc-group.phys.uwm.edu/daswg/wiki/HowtoGraceDb"
>
Howto page
</a></li>
<li><a
href=
"https://www.lsc-group.phys.uwm.edu/daswg/projects/gracedb.html"
>
DASWG Project page
</a></li>
<li><a
href=
"{% url "
shib:api-root
"
%}"
>
Browseable REST API
</a>
...
...
templates/rest_framework/api.html
View file @
d4e80b0d
{% extends "rest_framework/base.html" %}
{% block title %}G
race
DB REST API{% endblock %}
{% block title %}G
litch
DB REST API{% endblock %}
{% block branding %}
G
race
DB
—
REST API
G
litch
DB
—
REST API
{% if config_name %}
<span
style=
"color: red;"
>
{{config_name}}
...
...
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