akvo.rsr.models.budget_item module

class akvo.rsr.models.budget_item.BudgetItem(id, project, label, other_extra, amount, type, period_start, period_end, value_date, currency, status)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

OTHER_LABELS = ['other 1', 'other 2', 'other 3']
amount

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

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.

currency

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

get_currency()[source]
get_currency_display(*, field=<akvo.rsr.fields.ValidXMLCharField: currency>)
get_label()[source]

Needed since we have to have a vanilla __str__() method for the admin

get_status_display(*, field=<akvo.rsr.fields.ValidXMLCharField: status>)
get_type_display(*, field=<akvo.rsr.fields.ValidXMLCharField: type>)
iati_currency()[source]
iati_currency_unicode()[source]
iati_status()[source]
iati_status_unicode()[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.

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>
other_extra

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

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
status

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.

value_date

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.budget_item.BudgetItemLabel(id, label)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

TOTAL_BUDGET_LABEL_ID = 14
budgetitem_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.

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>
class akvo.rsr.models.budget_item.CountryBudgetItem(id, project, code, description, percentage)[source]

Bases: Model

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

code

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

description

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

get_code_display(*, field=<akvo.rsr.fields.ValidXMLCharField: code>)
iati_code()[source]
iati_code_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.

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

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