Commit 52d2f12b authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Add fields to VOEvents

There are several fields that the user provides to create a
VOEvent through the API, which are used in generating the VOEvent
file, but are not stored in the database. Let's fix this!!
parent 139cdc0c
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-15 18:07
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0033_pipelinelog_and_pipeline_enabled'),
]
operations = [
migrations.AddField(
model_name='voevent',
name='coinc_comment',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='voevent',
name='hardware_inj',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='voevent',
name='internal',
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name='voevent',
name='open_alert',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='voevent',
name='prob_bbh',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_bns',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_has_ns',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_has_remnant',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_mass_gap',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_nsbh',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_terrestrial',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='skymap_filename',
field=models.CharField(blank=True, default=None, max_length=100, null=True),
),
migrations.AddField(
model_name='voevent',
name='skymap_type',
field=models.CharField(blank=True, default=None, max_length=100, null=True),
),
migrations.AlterField(
model_name='voevent',
name='filename',
field=models.CharField(blank=True, default=b'', editable=False, max_length=100),
),
migrations.AlterField(
model_name='voevent',
name='ivorn',
field=models.CharField(blank=True, default=b'', editable=False, max_length=200),
),
]
......@@ -924,7 +924,7 @@ class Tag(CleanSaveModel):
return self.displayName if self.displayName else self.name
class VOEventBase(models.Model):
class VOEventBase(CleanSaveModel):
"""Abstract base model for VOEvents"""
class Meta:
......@@ -947,11 +947,42 @@ class VOEventBase(models.Model):
created = models.DateTimeField(auto_now_add=True)
issuer = models.ForeignKey(UserModel, null=False,
related_name='%(app_label)s_%(class)s_set')
ivorn = models.CharField(max_length=200, default="", blank=True)
filename = models.CharField(max_length=100, default="", blank=True)
ivorn = models.CharField(max_length=200, default="", blank=True,
editable=False)
filename = models.CharField(max_length=100, default="", blank=True,
editable=False)
file_version = models.IntegerField(null=True, default=None, blank=True)
N = models.IntegerField(null=False, editable=False)
voevent_type = models.CharField(max_length=2, choices=VOEVENT_TYPE_CHOICES)
skymap_type = models.CharField(max_length=100, null=True, default=None,
blank=True)
skymap_filename = models.CharField(max_length=100, null=True, default=None,
blank=True)
internal = models.BooleanField(null=False, default=True, blank=True)
open_alert = models.BooleanField(null=False, default=False, blank=True)
hardware_inj = models.BooleanField(null=False, default=False, blank=True)
coinc_comment = models.BooleanField(null=False, default=False, blank=True)
prob_has_ns = models.FloatField(null=True, default=None, blank=True,
validators=[models.fields.validators.MinValueValidator(0.0),
models.fields.validators.MaxValueValidator(1.0)])
prob_has_remnant = models.FloatField(null=True, default=None, blank=True,
validators=[models.fields.validators.MinValueValidator(0.0),
models.fields.validators.MaxValueValidator(1.0)])
prob_bns = models.FloatField(null=True, default=None, blank=True,
validators=[models.fields.validators.MinValueValidator(0.0),
models.fields.validators.MaxValueValidator(1.0)])
prob_nsbh = models.FloatField(null=True, default=None, blank=True,
validators=[models.fields.validators.MinValueValidator(0.0),
models.fields.validators.MaxValueValidator(1.0)])
prob_bbh = models.FloatField(null=True, default=None, blank=True,
validators=[models.fields.validators.MinValueValidator(0.0),
models.fields.validators.MaxValueValidator(1.0)])
prob_terrestrial = models.FloatField(null=True, default=None, blank=True,
validators=[models.fields.validators.MinValueValidator(0.0),
models.fields.validators.MaxValueValidator(1.0)])
prob_mass_gap = models.FloatField(null=True, default=None, blank=True,
validators=[models.fields.validators.MinValueValidator(0.0),
models.fields.validators.MaxValueValidator(1.0)])
def fileurl(self):
# Override this method on derived classes
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-05-15 18:07
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('superevents', '0002_fix_permission_typo'),
]
operations = [
migrations.AddField(
model_name='voevent',
name='coinc_comment',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='voevent',
name='hardware_inj',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='voevent',
name='internal',
field=models.BooleanField(default=True),
),
migrations.AddField(
model_name='voevent',
name='open_alert',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='voevent',
name='prob_bbh',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_bns',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_has_ns',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_has_remnant',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_mass_gap',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_nsbh',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='prob_terrestrial',
field=models.FloatField(blank=True, default=None, null=True, validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)]),
),
migrations.AddField(
model_name='voevent',
name='skymap_filename',
field=models.CharField(blank=True, default=None, max_length=100, null=True),
),
migrations.AddField(
model_name='voevent',
name='skymap_type',
field=models.CharField(blank=True, default=None, max_length=100, null=True),
),
migrations.AlterField(
model_name='voevent',
name='filename',
field=models.CharField(blank=True, default=b'', editable=False, max_length=100),
),
migrations.AlterField(
model_name='voevent',
name='ivorn',
field=models.CharField(blank=True, default=b'', editable=False, max_length=200),
),
]
......@@ -553,7 +553,7 @@ class Signoff(CleanSaveModel, SignoffBase):
instrument=self.instrument, status=self.status)
class VOEvent(CleanSaveModel, VOEventBase, AutoIncrementModel):
class VOEvent(VOEventBase, AutoIncrementModel):
"""VOEvent class for superevents"""
AUTO_FIELD = 'N'
AUTO_CONSTRAINTS = ('superevent',)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment