beat.web.reports.serializers module¶
-
class
beat.web.reports.serializers.BasicReportSerializer(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.reports.models.Report
-
fields= ['short_description', 'status', 'is_owner', 'accessibility']¶
-
-
class
-
class
beat.web.reports.serializers.SimpleReportSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶
-
class
beat.web.reports.serializers.FullReportSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
beat.web.reports.serializers.BasicReportSerializer-
class
Meta[source]¶ Bases:
beat.web.reports.serializers.Meta-
fields= ['name', 'number', 'short_description', 'description', 'is_owner', 'author', 'status', 'creation_date', 'publication_date', 'experiments', 'analyzer', 'content', 'html_description', 'experiment_access_map', 'analyzers_access_map']¶
-
-
class
-
class
beat.web.reports.serializers.CreatedReportSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶
-
class
beat.web.reports.serializers.UpdatedReportSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶
-
class
beat.web.reports.serializers.ReportCreationSerializer(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.reports.models.Report
-
fields= ['name', 'short_description', 'description', 'content', 'experiments']¶
-
-
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
-
class
beat.web.reports.serializers.ReportUpdateSerializer(instance=None, data=<class 'rest_framework.fields.empty'>, **kwargs)[source]¶ Bases:
beat.web.reports.serializers.ReportCreationSerializer