akvo.rsr.models.organisation_indicator_label module
- class akvo.rsr.models.organisation_indicator_label.OrganisationIndicatorLabel(id, organisation, label)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- class Organisation(*args, **kwargs)
Bases:
TimestampsMixin
There are four types of organisations in RSR, called Field, Support, Funding and Sponsor partner respectively.
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- NEW_TO_OLD_TYPES = ['G', 'G', 'N', 'N', 'N', 'N', 'N', 'N', 'C', 'K']
- active_projects()
- all_projects()
returns a queryset with all projects that has self as any kind of partner.
- all_updates()
Returns a queryset with all updates of the organisation.
Updates of the organisation are updates which have been:
Posted by users employed by the organisation AND
Posted on projects where the organisation is a partner.
- static all_updates_filter(org_id)
Returns a Q object for filtering updates for an organisation.
- all_users()
returns a queryset of all users belonging to the organisation
- amount_pledged()
How much the organisation has pledged to projects in default currency
- cacheable_url
- can_become_reporting
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- can_create_projects
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- property canonical_name
- clean()
Organisations can only be saved when we’re sure that they do not exist already.
- codelist
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 aForwardManyToOneDescriptor
instance.
- codelist_id
- contact_email
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- contact_person
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- content_owned_by()
Returns a list of Organisations of which this organisation is content owned by. Basically the reverse of content_owned_organisations(). Includes self.
- content_owned_organisations(exclude_orgs=None)
Returns a list of Organisations of which this organisation is the content owner. Includes self and is recursive.
- content_owner
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 aForwardManyToOneDescriptor
instance.
- content_owner_id
- countries_where_active()
Returns a Country queryset of countries where this organisation has published projects.
- created_at
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- currency
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- currency_label()
- custom_fields
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- description
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- documents
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- employees
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- enforce_2fa
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- enforce_program_projects
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- facebook
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- fax
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- field_partners()
Returns an Organisation queryset of field partners of which self has at least one project in common with.
- get_absolute_url()
- get_currency_display(*, field=<akvo.rsr.fields.ValidXMLCharField: currency>)
- get_language_display(*, field=<akvo.rsr.fields.ValidXMLCharField: language>)
- get_new_organisation_type_display(*, field=<django.db.models.fields.IntegerField: new_organisation_type>)
- get_organisation_type_display(*, field=<akvo.rsr.fields.ValidXMLCharField: organisation_type>)
- get_original()
Returns the original org if self is a shadow org
- has_multiple_project_currencies()
Check if organisation has projects with different currencies
- has_partner_types(project)
Return a list of partner types of this organisation to the project
- iati_exports
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- iati_file()
Looks up the latest public IATI file of this organisation.
- Returns:
String of IATI file or None
- iati_file_unicode()
- iati_org_id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- iati_org_type()
- iati_org_type_unicode()
- iati_prefixes
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- iatiorganisationvalidationjob_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 aReverseManyToOneDescriptor
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_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- internal_ids
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- internal_org_ids
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- language
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.
- linkedin
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- logo
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- long_name
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- mobile
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.
- new_organisation_type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- notes
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.OrganisationManagerFromOrganisationQuerySet object>
- org_currency_funds_needed()
How much is still needed to fully fund all projects with default currency budget that the organisation is a partner to.
The ORM aggregate() doesn’t work here since we may have multiple partnership relations to the same project.
- org_currency_projects_count()
How many projects with budget in default currency the organisation is a partner to
- classmethod org_type_from_iati_type(iati_type)
utility that maps the IATI organisation types to the old Akvo organisation types
- organisation_countries()
Returns a list of the organisations countries.
- organisation_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- organisation_type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- organisationaccount
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- original
Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
- original_id
- partners()
Returns a queryset of all organisations that self has at least one project in common with, excluding self.
- partnerships
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- partnersite_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- partnersites()
returns the partnersites belonging to the organisation in a PartnerSite queryset
- password_policy
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 aForwardManyToOneDescriptor
instance.
- password_policy_id
- phone
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- primary_location
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 aForwardManyToOneDescriptor
instance.
- primary_location_id
- project_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- projects
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- providing_disbursements
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- providing_transactions
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- public_iati_file
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- public_updates()
Returns a queryset with public updates of the organisation.
- published_projects(only_public=True)
returns a queryset with published projects that has self as any kind of partner
- receiver_org_budgets
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- receiving_disbursements
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- receiving_transactions
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- recipient_country_budgets
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- recipient_org_budgets
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- recipient_region_budgets
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- recording_organisation
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- reference_ids
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- report_set
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- reporting_on_projects()
returns a queryset with all projects that has self as reporting organisation.
- save(*args, **kwargs)
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.
- shadow
Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurant
is aReverseOneToOneDescriptor
instance.
- support_partners()
Returns a queryset of support partners that self has at least one project in common with, excluding self.
- total_budgets
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- total_expenditures
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- twitter
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- url
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- use_project_roles
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- users
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
andTopping.pizzas
areManyToManyDescriptor
instances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- website()
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- label
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- narrative_reports
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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- objects = <django.db.models.manager.Manager object>
- organisation
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 aForwardManyToOneDescriptor
instance.
- organisation_id