akvo.rsr.models.result package

class akvo.rsr.models.result.DefaultPeriod(id, project, parent, period_start, period_end)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

child_periods

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
parent

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_id
period_end

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

period_start

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
save(*args, **kwargs)[source]

Update the values of child results, if a parent result is updated.

class akvo.rsr.models.result.Disaggregation(*args, **kwargs)[source]

Bases: TimestampsMixin, IndicatorUpdateMixin, Model

Model for storing a disaggregated value along one axis of a dimension.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delete(*args, **kwargs)[source]
denominator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

dimension_value

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dimension_value_id
disaggregation_total()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

incomplete_data

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_modified_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

narrative

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numerator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

siblings()[source]
update

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

update_id
update_incomplete_data()[source]
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.DisaggregationContribution(*args, **kwargs)[source]

Bases: TimestampsMixin, IndicatorUpdateMixin, Model

Model to hold the disaggragation contribution

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

contributing_project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

contributing_project_id
created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

denominator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

disaggregation

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

disaggregation_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_modified_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numerator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.DisaggregationTarget(id, period, dimension_value, value)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

dimension_value

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dimension_value_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
period

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

period_id
project_relation = 'results__indicators__periods__disaggregation_targets__in'
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.Indicator(id, result, parent_indicator, title, type, measure, ascending, cumulative, description, baseline_year, baseline_value, baseline_comment, target_value, target_comment, order, export_to_iati, scores, baseline_score, target_score)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

INDICATOR_TYPES = ((1, 'Quantitative'), (2, 'Qualitative'))
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

ascending

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

baseline_comment

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

baseline_score

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

baseline_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

baseline_year

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

child_indicators

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

property children_aggregate_percentage

Returns True if this indicator has percentage as a measure and has children that aggregate to this indicator.

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

cumulative

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

custom_values

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

delete(*args, **kwargs)[source]

Check if indicator is ordered manually, and cascade following indicators if needed

descendants(depth=None)[source]
description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

dimension_names

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

disaggregation_targets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

enumerators

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

export_to_iati

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_measure_display(*, field=<akvo.rsr.fields.ValidXMLCharField: measure>)
get_type_display(*, field=<django.db.models.fields.PositiveSmallIntegerField: type>)
iati_measure()[source]
iati_measure_unicode()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

is_calculated()[source]
is_child_indicator()[source]

Indicates whether this indicator is linked to a parent indicator.

is_cumulative()[source]

The cumulative setting is ignored if the indicator is a percentage measure because the percentage measure can only be updated once per period.

is_parent_indicator()[source]

Indicates whether this indicator has children.

labels

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

measure

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
order

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

parent_indicator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_indicator_id
perioddisaggregation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

periods

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

project_relation = 'results__indicators__in'
references

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

result

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

result_id
save(*args, **kwargs)[source]

Update the values of child indicators, if a parent indicator is updated.

scores

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target_comment

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target_score

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.IndicatorCustomField(id, project, name, order, mandatory, help_text, type, dropdown_options)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

TYPES = (('text', 'Text'), ('boolean', 'Checkbox'), ('dropdown', 'Dropdown'))
dropdown_options

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_type_display(*, field=<akvo.rsr.fields.ValidXMLCharField: type>)
help_text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

mandatory

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
order

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

values

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class akvo.rsr.models.result.IndicatorCustomValue(id, indicator, custom_field, text_value, boolean_value, dropdown_selection)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

boolean_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

custom_field

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

custom_field_id
dropdown_selection

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

indicator_id
objects = <django.db.models.manager.Manager object>
project_relation = 'results__indicators__custom_values__in'
text_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.IndicatorDimensionName(id, project, name, parent_dimension_name)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

child_dimension_names

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

delete(*args, **kwargs)[source]
dimension_values

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicators

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_and_values()[source]
objects = <django.db.models.manager.Manager object>
parent_dimension_name

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_dimension_name_id
project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

class akvo.rsr.models.result.IndicatorDimensionValue(id, name, value, parent_dimension_value)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

child_dimension_values

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

delete(*args, **kwargs)[source]
disaggregation_targets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

disaggregations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicator_disaggregation_targets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

name

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

name_id
objects = <django.db.models.manager.Manager object>
parent_dimension_value

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_dimension_value_id
period_disaggregations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

project_relation = 'dimension_names__dimension_values__in'
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.IndicatorDisaggregationTarget(id, indicator, dimension_value, value)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

dimension_value

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dimension_value_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

indicator_id
objects = <django.db.models.manager.Manager object>
project_relation = 'results__indicators__disaggregation_targets__in'
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.IndicatorLabel(id, indicator, label)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

indicator_id
label

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

label_id
objects = <django.db.models.manager.Manager object>
project_relation = 'results__indicators__labels__in'
class akvo.rsr.models.result.IndicatorPeriod(id, indicator, parent_period, locked, period_start, period_end, target_value, target_comment, target_score, actual_value, actual_comment, numerator, denominator, narrative, score_index, score_indices, label)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

actual_comment

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

actual_locations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

actual_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

actual_value_is_decimal()[source]
adjacent_period(next_period=True)[source]

Returns the next or previous indicator period, if we can find one with a start date, and we have a start date ourselves.

:param next_period; Boolean indicating either the next (True) or previous (False) period.

aggregation_jobs

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

property approved_updates
can_save_update(update_id=None)[source]

Return True if an update can be created/updated on the indicator period.

If no update_id is passed, we check if a new update can be created. If an update_id is passed, we verify that the update can be modified.

Non percentage indicators can have multiple updates. If the indicator is a percentage indicator, we check that no other update is present, other than the one currently being created or changed.

child_aggregation_jobs

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

child_periods

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

data

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

denominator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

disaggregation_targets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

disaggregations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_root_period()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

indicator_id
is_calculated()[source]

When a period has got indicator updates, we consider the actual value to be a ‘calculated’ value, meaning that it’s not possible to update the actual value directly. Only through indicator updates.

is_child_period()[source]

Indicates whether this period is linked to a parent period

label

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

label_id
locked

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

narrative

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numerator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
parent_period

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_period_id
property percent_accomplishment

Return the percentage completed for this indicator period. If not possible to convert the values to numbers, return None.

property percent_accomplishment_100

Similar to the percent_accomplishment property. However, it won’t return any number bigger than 100.

period_end

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

period_start

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

periodactualvalue_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

perioddisaggregation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

property project
project_relation = 'results__indicators__periods__in'
save(*args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

score_index

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

score_indices

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target_comment

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target_locations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

target_score

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

target_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_actual_comment(save=True)[source]

Set the actual comment to the text of the latest approved update.

:param save; Boolean, save period if True :return Actual comment of period

update_score(save=True)[source]

Set the score of the period to the score of the latest approved update.

class akvo.rsr.models.result.IndicatorPeriodActualLocation(id, period, location)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
period

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

period_id
project_relation = 'results__indicators__periods__actual_locations__in'
class akvo.rsr.models.result.IndicatorPeriodData(*args, **kwargs)[source]

Bases: TimestampsMixin, IndicatorUpdateMixin, Model

Model for adding data to an indicator period.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

STATUSES = [('D', 'draft'), ('P', 'pending approval'), ('R', 'return for revision'), ('A', 'approved')]
STATUSES_LABELS_LIST = ['draft', 'pending approval', 'return for revision', 'approved']
STATUS_APPROVED = 'approved'
STATUS_APPROVED_CODE = 'A'
STATUS_CODES_LIST = ['D', 'P', 'R', 'A']
STATUS_DRAFT = 'draft'
STATUS_DRAFT_CODE = 'D'
STATUS_PENDING = 'pending approval'
STATUS_PENDING_CODE = 'P'
STATUS_REVISION = 'return for revision'
STATUS_REVISION_CODE = 'R'
UPDATE_METHODS = (('W', 'web'), ('M', 'mobile'))
approved_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

approved_by_id
clean()[source]

Perform several checks before we can actually save the update data.

comments

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delete(*args, **kwargs)[source]
denominator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

disaggregations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
property file_url

Returns the full URL of the file.

get_status_display(*, field=<akvo.rsr.fields.ValidXMLCharField: status>)
get_update_method_display(*, field=<akvo.rsr.fields.ValidXMLCharField: update_method>)
classmethod get_user_viewable_updates(queryset, user)[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicatorperioddatafile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

indicatorperioddataphoto_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

last_modified_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

narrative

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numerator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
period

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

period_id
photo

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

property photo_url

Returns the full URL of the photo.

project_relation = 'results__indicators__periods__data__in'
review_note

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

save(recalculate=True, *args, **kwargs)[source]

Save the current instance. Override this in a subclass if you want to control the saving process.

The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.

score_index

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

score_indices

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property status_display

Returns the display of the status.

text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

update_method

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.IndicatorPeriodDataComment(*args, **kwargs)[source]

Bases: TimestampsMixin

Model for adding comments to data of an indicator period.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

comment

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

data

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

data_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_modified_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
project_relation = 'results__indicators__periods__data__comments__in'
user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id
class akvo.rsr.models.result.IndicatorPeriodDataFile(id, update, file)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

file

The descriptor for the file attribute on the model instance. Return a FieldFile when accessed so you can write code like:

>>> from myapp.models import MyModel
>>> instance = MyModel.objects.get(pk=1)
>>> instance.file.size

Assign a file object on assignment so you can do:

>>> with open('/path/to/hello.world') as f:
...     instance.file = File(f)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
update

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

update_id
class akvo.rsr.models.result.IndicatorPeriodDataPhoto(id, update, photo)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
photo

Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.

update

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

update_id
class akvo.rsr.models.result.IndicatorPeriodDisaggregation(*args, **kwargs)[source]

Bases: TimestampsMixin, IndicatorUpdateMixin, Model

Model to hold aggregated disaggregation updates

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

contributors

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

created_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

denominator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

dimension_value

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

dimension_value_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

last_modified_at

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numerator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
period

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

period_id
project_relation = 'results__indicators__periods__disaggregations__in'
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.IndicatorPeriodLabel(*args, **kwargs)[source]

Bases: Model

Model for adding a label on an indicator period.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

label

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
periods

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
project_relation = ''
class akvo.rsr.models.result.IndicatorPeriodTargetLocation(id, period, location)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

location

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
period

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

period_id
project_relation = 'results__indicators__periods__target_locations__in'
class akvo.rsr.models.result.IndicatorReference(id, indicator, reference, vocabulary, vocabulary_uri)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_vocabulary_display(*, field=<akvo.rsr.fields.ValidXMLCharField: vocabulary>)
iati_vocabulary()[source]
iati_vocabulary_unicode()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

indicator_id
objects = <django.db.models.manager.Manager object>
project_relation = 'results__indicators__references__in'
reference

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

vocabulary

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

vocabulary_uri

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.NarrativeReport(id, project, category, text, published, period_start, period_end)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

category

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

category_id
clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

get_next_by_period_end(*, field=<django.db.models.fields.DateField: period_end>, is_next=True, **kwargs)
get_next_by_period_start(*, field=<django.db.models.fields.DateField: period_start>, is_next=True, **kwargs)
get_previous_by_period_end(*, field=<django.db.models.fields.DateField: period_end>, is_next=False, **kwargs)
get_previous_by_period_start(*, field=<django.db.models.fields.DateField: period_start>, is_next=False, **kwargs)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
period_end

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

period_start

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
published

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.PeriodActualValue(id, period, measure, value, numerator, denominator)[source]

Bases: View

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

denominator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

measure

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

numerator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
period

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

period_id
sql = '\n    SELECT\n        -- row_number() OVER... creates an artificial "pk" column, without which Django will protest\n        row_number() OVER (ORDER BY period.id) AS id,\n        period.id AS period_id,\n        indicator.measure as measure,\n        sum((update.value) :: DECIMAL(20,2)) AS value,\n        sum((update.numerator) :: DECIMAL(20,2)) AS numerator,\n        sum((update.denominator) :: DECIMAL(20,2)) AS denominator\n    FROM\n        rsr_indicatorperiod period,\n        rsr_indicator indicator,\n        rsr_indicatorperioddata update\n    WHERE\n        (\n            (((indicator.id = period.indicator_id) AND\n            (period.id = update.period_id)) AND\n            ((update.status) :: TEXT = \'A\' :: TEXT)) AND\n            ((update.value) :: TEXT ~ \'^\\d+\\.?\\d{0,2}$\' :: TEXT OR update.value IS NULL)\n        )\n    GROUP BY period.id, indicator.measure;\n'
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.PeriodDisaggregation(id, indicator, period, dimension_name, dimension_value, value, numerator, denominator)[source]

Bases: View

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

denominator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

dimension_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

dimension_value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicator

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

indicator_id
numerator

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
period

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

period_id
sql = '\n    WITH aggregated_disaggs AS (\n        SELECT\n            update.period_id,\n            disagg.dimension_value_id,\n            sum((disagg.value) :: DECIMAL(20,2)) AS value,\n            sum((disagg.numerator) :: DECIMAL(20,2)) AS numerator,\n            sum((disagg.denominator) :: DECIMAL(20,2)) AS denominator\n        FROM\n            rsr_disaggregation disagg,\n            rsr_indicatorperioddata "update"\n        WHERE\n            update.status = \'A\' AND\n            disagg.update_id = update.id\n        GROUP BY\n            disagg.dimension_value_id, update.period_id\n    ),\n    period_disaggs AS (\n        SELECT DISTINCT\n            indicator.id AS indicator_id,\n            period.id AS period_id,\n            dimensionname.name AS dimension_name,\n            dimensionvalue.value AS dimension_value,\n            agg.value,\n            agg.numerator,\n            agg.denominator\n        FROM\n            rsr_indicator indicator,\n            rsr_indicatorperiod period,\n            rsr_indicator_dimension_names indicator_dimensions,\n            aggregated_disaggs agg,\n            rsr_indicatordimensionname dimensionname,\n            rsr_indicatordimensionvalue dimensionvalue\n        WHERE\n            indicator.id = period.indicator_id AND\n            period.id = agg.period_id AND\n            dimensionvalue.id = agg.dimension_value_id AND\n            dimensionname.id = dimensionvalue.name_id AND\n            indicator_dimensions.indicatordimensionname_id = dimensionname.id AND\n            indicator_dimensions.indicator_id = indicator.id\n    )\n    SELECT\n        row_number() OVER (ORDER BY indicator_id) AS id,\n        *\n    FROM period_disaggs\n'
value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class akvo.rsr.models.result.Result(id, project, title, type, aggregation_status, description, parent_result, order)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

aggregation_status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

child_projects()[source]

Return a dictionary of this result’s child projects.

child_results

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

clean()[source]

Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.

delete(*args, **kwargs)[source]

Check if indicator is ordered manually, and cascade following indicators if needed

descendants(depth=None)[source]
description

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_type_display(*, field=<akvo.rsr.fields.ValidXMLCharField: type>)
has_info()[source]
iati_type()[source]
iati_type_unicode()[source]
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

indicators

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

is_calculated()[source]
objects = <django.db.models.manager.Manager object>
order

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

parent_project()[source]

Return a dictionary of this result’s parent project.

parent_result

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_result_id
project

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

project_id
save(*args, **kwargs)[source]

Update the values of child results, if a parent result is updated.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

Submodules