Skip to content

Commit

Permalink
Merge pull request #46 from observatorycontrolsystem/feature/flat-min…
Browse files Browse the repository at this point in the history
…-exptime

Feature/flat min exptime
  • Loading branch information
mgdaily authored Feb 28, 2023
2 parents 44674f7 + 3829c21 commit 6cedcb5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
3.0.4
2023-02-28
Add validation_schema to ConfigurationTypeProperties model to allow for more flexible validation of instrument configs per instrument type/configuration type

3.0.3
2023-01-18
Add back BasicAuth to rest framework and fix token auth for direct api queries
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.3 on 2023-02-24 23:26

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('hardware', '0034_copy_instrument_state'),
]

operations = [
migrations.AddField(
model_name='configurationtypeproperties',
name='validation_schema',
field=models.JSONField(blank=True, default=dict, help_text='Cerberus styled validation schema used to validate instrument configs using this configuration type and instrument type'),
),
]
5 changes: 5 additions & 0 deletions configdb/hardware/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ class ConfigurationTypeProperties(BaseModel):
'observation, like going between a Spectrum and a Lamp Flat for example. This could account for starting up '
'a lamp.'
)
validation_schema = models.JSONField(
default=dict,
blank=True,
help_text='Cerberus styled validation schema used to validate instrument configs using this configuration type and instrument type'
)

class Meta:
unique_together = ('instrument_type', 'configuration_type')
Expand Down
2 changes: 1 addition & 1 deletion configdb/hardware/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class ConfigurationTypePropertiesSerializer(serializers.ModelSerializer):
code = serializers.ReadOnlyField(source='configuration_type.code', help_text='Configuration type code')

class Meta:
fields = ('name', 'code', 'config_change_overhead', 'schedulable', 'force_acquisition_off', 'requires_optical_elements')
fields = ('name', 'code', 'config_change_overhead', 'schedulable', 'force_acquisition_off', 'requires_optical_elements', 'validation_schema')
model = ConfigurationTypeProperties


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "configdb"
version = "3.0.3"
version = "3.0.4"
description = "Configuration Database"
authors = ["Observatory Control System Project <[email protected]>"]
license = "GPL-3.0-only"
Expand Down

0 comments on commit 6cedcb5

Please sign in to comment.