diff --git a/gracedb/fixtures/initial_pipelines.json b/gracedb/fixtures/initial_pipelines.json index 52bcbcfc25066d0412e2942b872cd7e204ba1d45..0e5e2f3258632fab7c467e950999224d20fd6ec0 100644 --- a/gracedb/fixtures/initial_pipelines.json +++ b/gracedb/fixtures/initial_pipelines.json @@ -26,5 +26,54 @@ "fields": { "name": "gstlal-spiir" } + }, + { + "pk": 5, + "model": "gracedb.pipeline", + "fields": { + "name": "HardwareInjection" + } + }, + { + "pk": 6, + "model": "gracedb.pipeline", + "fields": { + "name": "X" + } + }, + { + "pk": 7, + "model": "gracedb.pipeline", + "fields": { + "name": "Q" + } + }, + { + "pk": 8, + "model": "gracedb.pipeline", + "fields": { + "name": "Omega" + } + }, + { + "pk": 9, + "model": "gracedb.pipeline", + "fields": { + "name": "Ringdown" + } + }, + { + "pk": 10, + "model": "gracedb.pipeline", + "fields": { + "name": "Fermi" + } + }, + { + "pk": 11, + "model": "gracedb.pipeline", + "fields": { + "name": "Swift" + } } ] diff --git a/gracedb/fixtures/initial_searches.json b/gracedb/fixtures/initial_searches.json index b3b1082f12777e14578eaf3e6590f553e98257ad..499088645973ca0f9664bca1de97d1daecc25589 100644 --- a/gracedb/fixtures/initial_searches.json +++ b/gracedb/fixtures/initial_searches.json @@ -2,30 +2,23 @@ { "pk": 1, "model": "gracedb.search", - "fields": { - "name": "MBTAOnline" - } - }, - { - "pk": 2, - "model": "gracedb.search", "fields": { "name": "AllSky", "description": "all-sky burst online" } }, { - "pk": 3, + "pk": 2, "model": "gracedb.search", "fields": { "name": "LowMass" } }, { - "pk": 4, + "pk": 3, "model": "gracedb.search", "fields": { "name": "HighMass" } } -] +] \ No newline at end of file diff --git a/gracedb/migrations/0019_auto__add_search__add_pipeline.py b/gracedb/migrations/0019_auto__add_search__add_pipeline.py index fc4c6c217df5cba7017a4b3641f618552b9d42e4..9369fefd866705e411f2a82787d2d8ce10a8de70 100644 --- a/gracedb/migrations/0019_auto__add_search__add_pipeline.py +++ b/gracedb/migrations/0019_auto__add_search__add_pipeline.py @@ -12,7 +12,7 @@ class Migration(SchemaMigration): db.create_table(u'gracedb_search', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('name', self.gf('django.db.models.fields.CharField')(max_length=100)), - ('description', self.gf('django.db.models.fields.TextField')(null=True)), + ('description', self.gf('django.db.models.fields.TextField')(blank=True)), )) db.send_create_signal(u'gracedb', ['Search']) @@ -176,7 +176,7 @@ class Migration(SchemaMigration): }, u'gracedb.search': { 'Meta': {'object_name': 'Search'}, - 'description': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) }, diff --git a/gracedb/models.py b/gracedb/models.py index 37843d11d7a968656c6a5a6d679e08fa4000f273..fc831aebad469f262cc9b939b1fbc7a1ddf291ab 100644 --- a/gracedb/models.py +++ b/gracedb/models.py @@ -59,7 +59,7 @@ class Pipeline(models.Model): class Search(models.Model): name = models.CharField(max_length=100) - description = models.TextField(null=True) + description = models.TextField(blank=True) # XXX Need any additional fields? Like a PI email? Or perhaps even fk? def __unicode__(self): return self.name @@ -95,6 +95,9 @@ class Event(models.Model): uid = models.CharField(max_length=20, default="") # XXX deprecated. should be removed. analysisType = models.CharField(max_length=20, choices=ANALYSIS_TYPE_CHOICES) + pipeline = models.ForeignKey(Pipeline) + search = models.ForeignKey(Search, null=True) + # from coinc_event instruments = models.CharField(max_length=20, default="") nevents = models.PositiveIntegerField(null=True)