Commit 615018d8 authored by Alexander Pace's avatar Alexander Pace
Browse files

time_coinc_far and space_coinc_far changes

modify the superevent model so that:
 1) coinc_far --> time_coinc_far
 2) new db column: space_coinc far.

These are now available as part of the API response, but the client
code needs to be modified to edit these values in updateSuperevent.
parent ba4dbc7b
Pipeline #111069 passed with stages
in 27 minutes and 35 seconds
......@@ -78,7 +78,8 @@ class SupereventSerializer(serializers.ModelSerializer):
model = Superevent
fields = ('superevent_id', 'gw_id', 'category', 'created', 'submitter',
'preferred_event', 'events', 'em_type', 't_start', 't_0', 't_end',
'gw_events', 'em_events', 'far', 'coinc_far', 'labels', 'links',
'gw_events', 'em_events', 'far', 'time_coinc_far',
'space_coinc_far', 'labels', 'links',
'user', 'preferred_event_data')
def validate(self, data):
......@@ -183,7 +184,7 @@ class SupereventUpdateSerializer(SupereventSerializer):
for object creation.
"""
allowed_fields = ('t_start', 't_0', 't_end', 'preferred_event',
'em_type', 'coinc_far')
'em_type', 'time_coinc_far', 'space_coinc_far')
def __init__(self, *args, **kwargs):
super(SupereventUpdateSerializer, self).__init__(*args, **kwargs)
......
......@@ -76,7 +76,7 @@ class SupereventViewSet(SafeCreateMixin, InheritDefaultPermissionsMixin,
ordering_fields = ('created', 't_0', 't_start', 't_end',
'preferred_event__id', 't_0_date', 'is_gw', 'base_date_number',
'gw_date_number', 'category',
'coinc_far','em_type')
'time_coinc_far','space_coinc_far','em_type')
def get_serializer_class(self):
"""Select a different serializer for updates"""
......
# Generated by Django 2.2.10 on 2020-03-13 19:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('superevents', '0007_auto_20200303_0151'),
]
operations = [
migrations.AlterField(
model_name='voevent',
name='voevent_type',
field=models.CharField(choices=[('PR', 'preliminary'), ('IN', 'initial'), ('UP', 'update'), ('RE', 'retraction'), ('EW', 'earlywarning')], max_length=2),
),
]
# Generated by Django 2.2.10 on 2020-03-13 19:27
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('superevents', '0008_auto_20200313_1918'),
]
operations = [
migrations.RenameField(
model_name='superevent',
old_name='coinc_far',
new_name='time_coinc_far',
),
]
# Generated by Django 2.2.10 on 2020-03-13 19:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('superevents', '0009_rename_coinc_far'),
]
operations = [
migrations.AddField(
model_name='superevent',
name='space_coinc_far',
field=models.FloatField(blank=True, null=True),
),
]
......@@ -119,7 +119,8 @@ class Superevent(CleanSaveModel, AutoIncrementModel):
is_exposed = models.BooleanField(default=False)
# New O3b fields for RAVEN:
coinc_far = models.FloatField(null=True, blank=True)
time_coinc_far = models.FloatField(null=True, blank=True)
space_coinc_far = models.FloatField(null=True, blank=True)
em_type = models.CharField(blank=True, null=True, max_length=100)
# Meta class --------------------------------------------------------------
......
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