Skip to content
Snippets Groups Projects
Commit e553d098 authored by Branson Craig Stephens's avatar Branson Craig Stephens
Browse files

Added new fields to event creation form.

parent 67728654
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment