diff --git a/SAS/TMSS/src/tmss/tmssapp/models/specification.py b/SAS/TMSS/src/tmss/tmssapp/models/specification.py index d1ff99e34b7795505d4d69e99a8c7c6393fb533b..d0b75b45733b8e30a182461bec8dfa0506882649 100644 --- a/SAS/TMSS/src/tmss/tmssapp/models/specification.py +++ b/SAS/TMSS/src/tmss/tmssapp/models/specification.py @@ -128,11 +128,11 @@ class CopyReason(AbstractChoice): class ResourceUnit(AbstractChoice): """Defines the model and predefined list of possible Unit's for Resources. The items in the Choises class below are automagically populated into the database via a data migration.""" - class Choices(Enum): - GIGABYTE = "Gigabyte" - TERABYTE = "Terabyte" - MINUTES = "Minutes" - HOURS = "Hours" +# class Choices(Enum): + # GIGABYTE = "Gigabyte" + # TERABYTE = "Terabyte" + # MINUTES = "Minutes" + # HOURS = "Hours" # concrete models @@ -219,12 +219,13 @@ class Project(NamedCommonPK): class ProjectQuotum(NamedCommonPK): project = ForeignKey('Project', related_name="project_quotums", on_delete=PROTECT, help_text='Project to wich this quota belongs.') # protected to avoid accidents + resource = FloatField(help_text='Resource Quota value') + resource_type = ForeignKey('ResourceType', related_name="resource_type", on_delete=PROTECT, help_text='Resource type.') # protected to avoid accidents #lta_storage = FloatField(help_text='LTA storage offered for the project') #observation_hours = IntegerField(help_text='Number of offered hours for observations.') #processing_hours = IntegerField(help_text='Number of offered hours for processing.') class ResourceType(NamedCommonPK): - resource = FloatField(help_text='Resource value') resource_unit = ForeignKey('ResourceUnit', null=False, on_delete=PROTECT, help_text='Unit of current resource.') class SchedulingSet(NamedCommon): diff --git a/SAS/TMSS/src/tmss/tmssapp/serializers/specification.py b/SAS/TMSS/src/tmss/tmssapp/serializers/specification.py index 2c877f09d559cb172a648713254d394328b2c24f..cd44cf7637229ceda6955b335149fa21f5ff289c 100644 --- a/SAS/TMSS/src/tmss/tmssapp/serializers/specification.py +++ b/SAS/TMSS/src/tmss/tmssapp/serializers/specification.py @@ -123,7 +123,7 @@ class ProjectQuotumSerializer(RelationalHyperlinkedModelSerializer): class Meta: model = models.ProjectQuotum fields = '__all__' - extra_fields = ['name'] + extra_fields = ['name','resource_type'] class ResourceTypeSerializer(RelationalHyperlinkedModelSerializer): class Meta: