Skip to content
Snippets Groups Projects
Commit 12b7e532 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB
Browse files

Adding a __unicode__ display for labelling model

parent b56cc9c9
No related branches found
No related tags found
1 merge request!8Superevents
......@@ -304,6 +304,8 @@ class Superevent(CleanSaveModel, ModelToDictMixin, AutoIncrementModel):
letter_suffix
# Custom methods ----------------------------------------------------------
# TODO: may want to add select or prefetch here to speed up access to group
# names, since that is used in calculating the graceid as well
def get_external_events(self):
"""Returns a queryset of external events"""
return self.events.filter(group__name=settings.EXTERNAL_ANALYSIS_GROUP)
......@@ -372,6 +374,10 @@ class Labelling(m2mThroughBase):
related_name='%(app_label)s_%(class)s_set',
on_delete=models.CASCADE)
def __unicode__(self):
return "{superevent_id} | {label}".format(superevent_id=
self.superevent.superevent_id, label=self.label.name)
class Signoff(CleanSaveModel, SignoffBase):
"""Class for superevent signoffs"""
......
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