beat.web.experiments.serializers module

class beat.web.experiments.serializers.ExperimentCreationSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]

Bases: object

model

alias of beat.web.experiments.models.experiment.Experiment

beat_core_class

alias of beat.core.experiment.Experiment

fields = ['name', 'short_description', 'description', 'declaration', 'toolchain', 'fork_of']
toolchain_queryset()[source]
validate_name(name)[source]
validate_description(description)[source]
validate_toolchain(toolchain)[source]
validate(data)[source]
create(validated_data)[source]

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

class beat.web.experiments.serializers.ExperimentSerializer(*args, **kwargs)[source]

Bases: beat.web.common.serializers.ShareableSerializer

class Meta[source]

Bases: object

model

alias of beat.web.experiments.models.experiment.Experiment

fields = '__all__'
default_fields = ['is_owner', 'modifiable', 'deletable', 'sharing', 'name', 'toolchain', 'datasets', 'short_description', 'creation_date', 'start_date', 'end_date', 'duration', 'status', 'accessibility', 'attestation_number', 'attestation_locked', 'cpu_time', 'data_read', 'data_written', 'is_owner']
get_datasets(obj)[source]
get_start_date(obj)[source]
get_end_date(obj)[source]
get_duration(obj)[source]
get_cpu_time(obj)[source]
get_data_read(obj)[source]
get_data_written(obj)[source]
class beat.web.experiments.serializers.AnalyzerSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]

Bases: object

model

alias of beat.web.experiments.models.block.Block

fields = '__all__'
get_results(obj)[source]
class beat.web.experiments.serializers.BlockErrorSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]

Bases: rest_framework.serializers.ModelSerializer

class Meta[source]

Bases: object

model

alias of beat.web.experiments.models.block.Block

fields = '__all__'
class beat.web.experiments.serializers.ExperimentResultsSerializer(*args, **kwargs)[source]

Bases: beat.web.common.serializers.ShareableSerializer

class Meta[source]

Bases: beat.web.common.serializers.Meta

model

alias of beat.web.experiments.models.experiment.Experiment

fields = '__all__'
default_fields = ['started', 'done', 'failed', 'status', 'blocks_status', 'results', 'attestation', 'declaration', 'errors', 'sharing', 'accessibility', 'execution_info', 'execution_order']
get_started(obj)[source]
get_done(obj)[source]
get_failed(obj)[source]
get_blocks_status(obj)[source]
get_execution_info(obj)[source]
get_execution_order(obj)[source]
get_results(obj)[source]
get_errors(obj)[source]
get_html_description(obj)[source]
get_description(obj)[source]
get_display_start_date(obj)[source]
get_display_end_date(obj)[source]