Skip to content

Commit 6cedcb5

Browse files
authored
Merge pull request #46 from observatorycontrolsystem/feature/flat-min-exptime
Feature/flat min exptime
2 parents 44674f7 + 3829c21 commit 6cedcb5

File tree

5 files changed

+29
-2
lines changed

5 files changed

+29
-2
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
3.0.4
2+
2023-02-28
3+
Add validation_schema to ConfigurationTypeProperties model to allow for more flexible validation of instrument configs per instrument type/configuration type
4+
15
3.0.3
26
2023-01-18
37
Add back BasicAuth to rest framework and fix token auth for direct api queries
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.0.3 on 2023-02-24 23:26
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('hardware', '0034_copy_instrument_state'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='configurationtypeproperties',
15+
name='validation_schema',
16+
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'),
17+
),
18+
]

configdb/hardware/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ class ConfigurationTypeProperties(BaseModel):
276276
'observation, like going between a Spectrum and a Lamp Flat for example. This could account for starting up '
277277
'a lamp.'
278278
)
279+
validation_schema = models.JSONField(
280+
default=dict,
281+
blank=True,
282+
help_text='Cerberus styled validation schema used to validate instrument configs using this configuration type and instrument type'
283+
)
279284

280285
class Meta:
281286
unique_together = ('instrument_type', 'configuration_type')

configdb/hardware/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class ConfigurationTypePropertiesSerializer(serializers.ModelSerializer):
9090
code = serializers.ReadOnlyField(source='configuration_type.code', help_text='Configuration type code')
9191

9292
class Meta:
93-
fields = ('name', 'code', 'config_change_overhead', 'schedulable', 'force_acquisition_off', 'requires_optical_elements')
93+
fields = ('name', 'code', 'config_change_overhead', 'schedulable', 'force_acquisition_off', 'requires_optical_elements', 'validation_schema')
9494
model = ConfigurationTypeProperties
9595

9696

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "configdb"
3-
version = "3.0.3"
3+
version = "3.0.4"
44
description = "Configuration Database"
55
authors = ["Observatory Control System Project <[email protected]>"]
66
license = "GPL-3.0-only"

0 commit comments

Comments
 (0)