akvo.rest.serializers.indicator_period module

class akvo.rest.serializers.indicator_period.DisaggregationTargetNestedSerializer(*args, **kwargs)[source]

Bases: BaseRSRSerializer

class Meta[source]

Bases: object

fields = '__all__'
model

alias of DisaggregationTarget

read_only_fields = ('id', 'period')
class akvo.rest.serializers.indicator_period.IndicatorPeriodFrameworkLiteSerializer(*args, **kwargs)[source]

Bases: BaseRSRSerializer

class Meta[source]

Bases: object

fields = '__all__'
model

alias of IndicatorPeriod

get_disaggregation_targets(obj)[source]
class akvo.rest.serializers.indicator_period.IndicatorPeriodFrameworkNotSoLiteSerializer(*args, **kwargs)[source]

Bases: BaseRSRSerializer

class Meta[source]

Bases: object

fields = '__all__'
model

alias of IndicatorPeriod

get_actual_value(obj)[source]
get_disaggregation_targets(obj)[source]
get_target_value(obj)[source]
get_updates(obj: IndicatorPeriod)[source]
class akvo.rest.serializers.indicator_period.IndicatorPeriodFrameworkSerializer(*args, **kwargs)[source]

Bases: BaseRSRSerializer

class Meta[source]

Bases: object

fields = '__all__'
model

alias of IndicatorPeriod

get_disaggregation_targets(obj)[source]
get_updates(obj)[source]
class akvo.rest.serializers.indicator_period.IndicatorPeriodSerializer(*args, **kwargs)[source]

Bases: BaseRSRSerializer

class Meta[source]

Bases: object

fields = '__all__'
model

alias of IndicatorPeriod

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.

update(instance, validated_data)[source]
validate_disaggregation_targets(data)[source]
akvo.rest.serializers.indicator_period.create_or_update_disaggregation_targets(instance, disaggregation_targets)[source]
akvo.rest.serializers.indicator_period.serialize_disaggregation_targets(period)[source]