diff --git a/gracedb/forms.py b/gracedb/forms.py index 5549884197135a3aac02349a55c27381cfde2484..d328ec9c2d0149525379cfcd0fffa1aebfb8eeb4 100644 --- a/gracedb/forms.py +++ b/gracedb/forms.py @@ -3,6 +3,7 @@ from django import forms from django.utils.safestring import mark_safe from django.utils.html import escape from models import Event, Group, Label +from models import Pipeline, Search from django.contrib.auth.models import User from django.core.exceptions import FieldError @@ -39,11 +40,15 @@ class SimpleSearchForm(forms.Form): class CreateEventForm(forms.Form): groupChoices = [("","")]+[(g.name, g.name) for g in Group.objects.all()] - typeChoices= [("","")]+list(Event.ANALYSIS_TYPE_CHOICES) - + #typeChoices= [("","")]+list(Event.ANALYSIS_TYPE_CHOICES) + pipelineChoices = [("","")]+[(p.name, p.name) for p in Pipeline.objects.all()] + searchChoices = [("","")]+[(s.name, s.name) for s in Search.objects.all()] + eventFile = forms.FileField() group = forms.ChoiceField(groupChoices) - type = forms.ChoiceField(choices=typeChoices) + pipeline = forms.ChoiceField(pipelineChoices) + search = forms.ChoiceField(searchChoices) + #type = forms.ChoiceField(choices=typeChoices) class EventSearchForm(forms.Form): diff --git a/gracedb/models.py b/gracedb/models.py index 6c7b25171d9975bde7b2d77dc559308d2685106f..d0986a5b959538ee05fcece88018576f6f3565e0 100644 --- a/gracedb/models.py +++ b/gracedb/models.py @@ -77,18 +77,18 @@ class Event(models.Model): objects = InheritanceManager() # Queries can return subclasses, if available. -# ANALYSIS_TYPE_CHOICES = ( -# ("LM", "LowMass"), -# ("HM", "HighMass"), -# ("GRB", "GRB"), -# ("RD", "Ringdown"), -# ("OM", "Omega"), -# ("Q", "Q"), -# ("X", "X"), -# ("CWB", "CWB"), -# ("MBTA", "MBTAOnline"), -# ("HWINJ", "HardwareInjection"), -# ) + ANALYSIS_TYPE_CHOICES = ( + ("LM", "LowMass"), + ("HM", "HighMass"), + ("GRB", "GRB"), + ("RD", "Ringdown"), + ("OM", "Omega"), + ("Q", "Q"), + ("X", "X"), + ("CWB", "CWB"), + ("MBTA", "MBTAOnline"), + ("HWINJ", "HardwareInjection"), + ) DEFAULT_EVENT_NEIGHBORHOOD = (-5,5) submitter = models.ForeignKey(DjangoUser)