Commit 660e0582 authored by Ryan Herbert's avatar Ryan Herbert Committed by Mathieu Giraud

SampleSet.py, generic.py, zmodel_factory.py: polymorphism

Follows 61ff3343.
See #2282.
parent 7a274ccc
...@@ -7,7 +7,7 @@ class SampleSet(object): ...@@ -7,7 +7,7 @@ class SampleSet(object):
return self.type return self.type
def get_type_display(self): def get_type_display(self):
return 'set' if self.type == defs.SET_TYPE_GENERIC else self.type return self.type
def __getitem__(self, key): def __getitem__(self, key):
return getattr(self, key, None) return getattr(self, key, None)
......
class Generic(SampleSet):
def __init__(self, type):
super(Generic, self).__init__(type)
def get_type_display(self):
return 'set'
from enum import Enum from enum import Enum
class FactoryEnum(Enum): class FactoryEnum(Enum):
generic = SampleSet generic = Generic
patient = Patient patient = Patient
run = Run run = Run
......
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