akvo.rsr.models.project module
Akvo RSR is covered by the GNU Affero General Public License.
See more details in the license.txt file located at the root folder of the Akvo RSR module. For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
- akvo.rsr.models.project.DESCRIPTIONS_ORDER = ['project_plan_summary', 'goals_overview', 'background', 'current_status', 'target_group', 'project_plan', 'sustainability']
Projects in the process of being deleted Some signals attempt to update projects and they shouldn’t attempt to do so
when a project is being deleted
- class akvo.rsr.models.project.Project(id, created_at, last_modified_at, path, uuid, title, subtitle, status, iati_status, project_plan_summary, current_image, current_image_caption, current_image_credit, goals_overview, current_status, project_plan, sustainability, background, target_group, descriptions_order, aggregate_children, aggregate_to_parent, is_impact_project, is_public, contributes_to_project, external_parent_iati_activity_id, language, notes, targets_at, currency, date_start_planned, date_start_actual, date_end_planned, date_end_actual, primary_location, primary_organisation, donate_url, donations, iati_activity_id, hierarchy, project_scope, capital_spend_percentage, collaboration_type, default_aid_type_vocabulary, default_aid_type, default_finance_type, default_flow_type, default_tied_status, country_budget_vocabulary, humanitarian, use_project_roles, run_iati_checks, budget, funds, funds_needed, last_update)[source]
Bases:
TimestampsMixin
,AkvoTreeModel
- CODE_TO_STATUS = {'': 'N', '1': 'H', '2': 'A', '3': 'C', '4': 'C', '5': 'L', '6': 'C'}
- CURRENCY_CHOICES = [('AED', 'AED - UAE Dirham'), ('AFN', 'AFN - Afghani'), ('ALL', 'ALL - Lek'), ('AMD', 'AMD - Armenian Dram'), ('ANG', 'ANG - Netherlands Antillian Guilder'), ('AOA', 'AOA - Kwanza'), ('ARS', 'ARS - Argentine Peso'), ('AUD', 'AUD - Australian Dollar'), ('AWG', 'AWG - Aruban Guilder'), ('AZN', 'AZN - Azerbaijanian Manat'), ('BAM', 'BAM - Convertible Marks'), ('BBD', 'BBD - Barbados Dollar'), ('BDT', 'BDT - Taka'), ('BGN', 'BGN - Bulgarian Lev'), ('BHD', 'BHD - Bahraini Dinar'), ('BIF', 'BIF - Burundi Franc'), ('BMD', 'BMD - Bermudian Dollar'), ('BND', 'BND - Brunei Dollar'), ('BOB', 'BOB - Boliviano'), ('BOV', 'BOV - Mvdol'), ('BRL', 'BRL - Brazilian Real'), ('BSD', 'BSD - Bahamian Dollar'), ('BTN', 'BTN - Ngultrum'), ('BWP', 'BWP - Pula'), ('BYR', 'BYR - Belarussian Ruble'), ('BYN', 'BYN - Belarussian Ruble'), ('BZD', 'BZD - Belize Dollar'), ('CAD', 'CAD - Canadian Dollar'), ('CDF', 'CDF - Congolese Franc'), ('CHF', 'CHF - Swiss Franc'), ('CLF', 'CLF - Unidades de fomento'), ('CLP', 'CLP - Chilean Peso'), ('CNY', 'CNY - Yuan Renminbi'), ('COP', 'COP - Colombian Peso'), ('COU', 'COU - Unidad de Valor Real'), ('CRC', 'CRC - Costa Rican Colon'), ('CUC', 'CUC - Peso Convertible'), ('CUP', 'CUP - Cuban Peso'), ('CVE', 'CVE - Cape Verde Escudo'), ('CZK', 'CZK - Czech Koruna'), ('DJF', 'DJF - Djibouti Franc'), ('DKK', 'DKK - Danish Krone'), ('DOP', 'DOP - Dominican Peso'), ('DZD', 'DZD - Algerian Dinar'), ('EEK', 'EEK - Kroon'), ('EGP', 'EGP - Egyptian Pound'), ('ERN', 'ERN - Nakfa'), ('ETB', 'ETB - Ethiopian Birr'), ('EUR', 'EUR - Euro'), ('FJD', 'FJD - Fiji Dollar'), ('FKP', 'FKP - Falkland Islands Pound'), ('GBP', 'GBP - Pound Sterling'), ('GEL', 'GEL - Lari'), ('GHS', 'GHS - Cedi'), ('GIP', 'GIP - Gibraltar Pound'), ('GMD', 'GMD - Dalasi'), ('GNF', 'GNF - Guinea Franc'), ('GTQ', 'GTQ - Quetzal'), ('GYD', 'GYD - Guyana Dollar'), ('HKD', 'HKD - Hong Kong Dollar'), ('HNL', 'HNL - Lempira'), ('HRK', 'HRK - Kuna'), ('HTG', 'HTG - Gourde'), ('HUF', 'HUF - Forint'), ('IDR', 'IDR - Rupiah'), ('ILS', 'ILS - New Israeli Sheqel'), ('INR', 'INR - Indian Rupee'), ('IQD', 'IQD - Iraqi Dinar'), ('IRR', 'IRR - Iranian Rial'), ('ISK', 'ISK - Iceland Krona'), ('JMD', 'JMD - Jamaican Dollar'), ('JOD', 'JOD - Jordanian Dinar'), ('JPY', 'JPY - Yen'), ('KES', 'KES - Kenyan Shilling'), ('KGS', 'KGS - Som'), ('KHR', 'KHR - Riel'), ('KMF', 'KMF - Comoro Franc'), ('KPW', 'KPW - North Korean Won'), ('KRW', 'KRW - Won'), ('KWD', 'KWD - Kuwaiti Dinar'), ('KYD', 'KYD - Cayman Islands Dollar'), ('KZT', 'KZT - Tenge'), ('LAK', 'LAK - Kip'), ('LBP', 'LBP - Lebanese Pound'), ('LKR', 'LKR - Sri Lanka Rupee'), ('LRD', 'LRD - Liberian Dollar'), ('LSL', 'LSL - Loti'), ('LTL', 'LTL - Lithuanian Litas'), ('LVL', 'LVL - Latvian Lats'), ('LYD', 'LYD - Libyan Dinar'), ('MAD', 'MAD - Moroccan Dirham'), ('MDL', 'MDL - Moldovan Leu'), ('MGA', 'MGA - Malagasy Ariary'), ('MKD', 'MKD - Denar'), ('MMK', 'MMK - Kyat'), ('MNT', 'MNT - Tugrik'), ('MOP', 'MOP - Pataca'), ('MRO', 'MRO - Ouguiya'), ('MRU', 'MRU - Ouguiya'), ('MUR', 'MUR - Mauritius Rupee'), ('MVR', 'MVR - Rufiyaa'), ('MWK', 'MWK - Malawi Kwacha'), ('MXN', 'MXN - Mexican Peso'), ('MXV', 'MXV - Mexican Unidad de Inversion (UDI)'), ('MYR', 'MYR - Malaysian Ringgit'), ('MZN', 'MZN - Metical'), ('NAD', 'NAD - Namibia Dollar'), ('NGN', 'NGN - Naira'), ('NIO', 'NIO - Cordoba Oro'), ('NOK', 'NOK - Norwegian Krone'), ('NPR', 'NPR - Nepalese Rupee'), ('NZD', 'NZD - New Zealand Dollar'), ('OMR', 'OMR - Rial Omani'), ('PAB', 'PAB - Balboa'), ('PEN', 'PEN - Nuevo Sol'), ('PGK', 'PGK - Kina'), ('PHP', 'PHP - Philippine Peso'), ('PKR', 'PKR - Pakistan Rupee'), ('PLN', 'PLN - Zloty'), ('PYG', 'PYG - Guarani'), ('QAR', 'QAR - Qatari Rial'), ('RON', 'RON - Romanian Leu'), ('RSD', 'RSD - Serbian Dinar'), ('RUB', 'RUB - Russian Ruble'), ('RWF', 'RWF - Rwanda Franc'), ('SAR', 'SAR - Saudi Riyal'), ('SBD', 'SBD - Solomon Islands Dollar'), ('SCR', 'SCR - Seychelles Rupee'), ('SDG', 'SDG - Sudanese Pound'), ('SEK', 'SEK - Swedish Krona'), ('SGD', 'SGD - Singapore Dollar'), ('SHP', 'SHP - Saint Helena Pound'), ('SLL', 'SLL - Leone'), ('SOS', 'SOS - Somali Shilling'), ('SSP', 'SSP - South Sudanese Pound'), ('SRD', 'SRD - Surinam Dollar'), ('STD', 'STD - Dobra'), ('STN', 'STN - Dobra'), ('SVC', 'SVC - El Salvador Colon'), ('SYP', 'SYP - Syrian Pound'), ('SZL', 'SZL - Lilangeni'), ('THB', 'THB - Baht'), ('TJS', 'TJS - Somoni'), ('TMT', 'TMT - Manat'), ('TND', 'TND - Tunisian Dinar'), ('TOP', 'TOP - Paanga'), ('TRY', 'TRY - Turkish Lira'), ('TTD', 'TTD - Trinidad and Tobago Dollar'), ('TWD', 'TWD - New Taiwan Dollar'), ('TZS', 'TZS - Tanzanian Shilling'), ('UAH', 'UAH - Hryvnia'), ('UGX', 'UGX - Uganda Shilling'), ('USD', 'USD - US Dollar'), ('USN', 'USN - US Dollar (Next day)'), ('USS', 'USS - US Dollar (Same day)'), ('UYI', 'UYI - Uruguay Peso en Unidades Indexadas'), ('UYU', 'UYU - Peso Uruguayo'), ('UZS', 'UZS - Uzbekistan Sum'), ('VEF', 'VEF - Bolivar'), ('VES', 'VES - Bolivar Soberano'), ('VND', 'VND - Dong'), ('VUV', 'VUV - Vatu'), ('WST', 'WST - Tala'), ('XAF', 'XAF - CFA Franc BEAC'), ('XBT', 'XBT - Bitcoin'), ('XCD', 'XCD - East Caribbean Dollar'), ('XDR', 'XDR - International Monetary Fund (IMF) Special Drawing Right (SDR)'), ('XOF', 'XOF - CFA Franc BCEAO'), ('XPF', 'XPF - CFP Franc'), ('YER', 'YER - Yemeni Rial'), ('ZAR', 'ZAR - Rand'), ('ZMK', 'ZMK - Zambian Kwacha'), ('ZMW', 'ZMW - Zambian Kwacha'), ('ZWL', 'ZWL - Zimbabwe Dollar')]
- DONATE_DISABLED = ['', '3', '4', '5', '6']
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- EDIT_DISABLED = []
- HIERARCHY_OPTIONS = ((1, 'Core Activity'), (2, 'Sub Activity'), (3, 'Lower Sub Activity'))
- LANGUAGE_OPTIONS = (('de', 'German'), ('en', 'English'), ('es', 'Spanish'), ('fr', 'French'), ('nl', 'Dutch'), ('ru', 'Russian'))
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- NOT_SUSPENDED = ['', '1', '2', '3', '4', '5']
- STATUSES = (('N', ''), ('H', 'Needs funding'), ('A', 'Active'), ('C', 'Complete'), ('L', 'Cancelled'), ('R', 'Archived'))
- STATUSES_COLORS = {'': 'grey', '1': 'orange', '2': '#AFF167', '3': 'grey', '4': 'grey', '5': 'red', '6': 'grey'}
- STATUS_ACTIVE = 'A'
- STATUS_ARCHIVED = 'R'
- STATUS_CANCELLED = 'L'
- STATUS_COMPLETE = 'C'
- STATUS_NEEDS_FUNDING = 'H'
- STATUS_NONE = 'N'
- STATUS_TO_CODE = {'A': '2', 'C': '3', 'H': '1', 'L': '5', 'N': '', 'R': '3'}
- TARGETS_AT_OPTION = (('period', 'Period'), ('indicator', 'Indicator'), ('both', 'Both'))
- accepts_donations()[source]
Returns True if a project accepts donations, otherwise False. A project accepts donations when the donate url is set, the project is published, the project needs funding and is not cancelled or archived.
- aggregate_children
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- aggregate_to_parent
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- background
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- benchmarks
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.
- budget
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- budget_items
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.
- cacheable_url
- capital_spend_percentage
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- categories
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.
- check_imported_results()[source]
Ensure that a project doesn’t have results which were imported from a parent
- check_old_parent_results(new_parent: Project)[source]
Ensure imported results all point to the new parent
- 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.
- collaboration_type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- conditions
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.
- contacts
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.
- contributes_to_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 aForwardManyToOneDescriptor
instance.
- contributes_to_project_id
- copy_default_period_to_children(default_period)[source]
Copy default period to all children that imported results from this project.
- copy_dimension_name_to_children(dimension_name)[source]
Copy dimension_name to all children that imported from this project.
- copy_indicator(result, source_indicator, set_parent=True)[source]
Copy a source_indicator to the result, setting it as parent if specified.
NOTE: There can only be one child for an indicator, per result. This method automatically updates an existing child indicator, if present.
It also triggers the creation of periods, dimensions and references on the indicator, if the indicator is being created and not updated.
- copy_period(indicator, source_period, set_parent=True)[source]
Copy the source period to the indicator, and set it as a parent if specified.
NOTE: There can only be one child for a period, per indicator. This method automatically updates the existing one, if there is one.
- copy_result(source_result, set_parent=True)[source]
Copy the source_result to this project, setting it as parent if specified.
- copy_result_to_children(result)[source]
Copy result to all children that imported results from this project.
- country_budget_items
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.
- country_budget_vocabulary
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.
- crsadd
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.
- currency
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- current_image
Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
- current_image_caption
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- current_image_credit
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- current_status
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- date_end_actual
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date_end_planned
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date_start_actual
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- date_start_planned
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- default_aid_type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- default_aid_type_vocabulary
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- default_finance_type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- default_flow_type
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- default_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- default_tied_status
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- descriptions_order
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 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.
- disaggregation_contributions
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.
- 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.
- donate_url
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- donations
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- external_parent_iati_activity_id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- find_primary_organisation()[source]
This method tries to return the “managing” partner organisation.
- fss
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.
- funding_partnerships()[source]
Return the Partnership objects associated with the project that have funding information
- funds
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- funds_needed
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_collaboration_type_display(*, field=<akvo.rsr.fields.ValidXMLCharField: collaboration_type>)
- get_country_budget_vocabulary_display(*, field=<akvo.rsr.fields.ValidXMLCharField: country_budget_vocabulary>)
- get_currency_display(*, field=<akvo.rsr.fields.ValidXMLCharField: currency>)
- get_default_aid_type_vocabulary_display(*, field=<akvo.rsr.fields.ValidXMLCharField: default_aid_type_vocabulary>)
- get_default_finance_type_display(*, field=<akvo.rsr.fields.ValidXMLCharField: default_finance_type>)
- get_default_flow_type_display(*, field=<akvo.rsr.fields.ValidXMLCharField: default_flow_type>)
- get_default_tied_status_display(*, field=<akvo.rsr.fields.ValidXMLCharField: default_tied_status>)
- get_funds_needed()[source]
How much more is needed to fulfill the project’s budget needs. In case of a negative value or a value less than 1, the value is set to 0.
- get_funds_needed_project_currency()[source]
Funds need in project currency, only used if budget items have multiple currencies
- get_hierarchy_display(*, field=<django.db.models.fields.PositiveIntegerField: hierarchy>)
- get_iati_status_display(*, field=<akvo.rsr.fields.ValidXMLCharField: iati_status>)
- get_language_display(*, field=<akvo.rsr.fields.ValidXMLCharField: language>)
- get_project_scope_display(*, field=<akvo.rsr.fields.ValidXMLCharField: project_scope>)
- get_status_display(*, field=<akvo.rsr.fields.ValidXMLCharField: status>)
- get_targets_at_display(*, field=<akvo.rsr.fields.ValidXMLCharField: targets_at>)
- goals
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.
- goals_overview
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- hierarchy
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- humanitarian
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- humanitarian_scopes
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_activity_id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- iati_checks
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_prefixes()[source]
Return the IATI ID prefixes for the project.
Based on the reporting organisations, returns the IATI prefixes.
- iati_project_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_status
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- iatiactivityvalidationjob_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.
- iatiexport_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.
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- import_indicator(parent_indicator_id)[source]
- Parameters:
parent_indicator_id – ID of indicator we want to create a child of in this self’s
results framework :return: new indicator object or None if it couldn’t be imported/added
- indicator_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.
- is_impact_project
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_public
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_unep_project
- keywords
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.
- property last_modified_by
Return the user who last edited this project and when the edit was made.
- last_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 aForwardManyToOneDescriptor
instance.
- last_update_id
- legacy_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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- links
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.
- 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.
- 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.
- classmethod new_project_created(project_id, user)[source]
Hook to do some book-keeping for a newly created project.
NOTE: This hook cannot be moved into a post-save hook since we need information about the user who created this project, to perform some of the actions.
- 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.ManagerFromProjectQuerySet object>
- partner_organisation_pks()[source]
Return all organisation ids along with hierarchy owner
If project is in a hierarchy, includes the hierarchy owner in the partners list.
- partners
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.
- partners_info()[source]
Return a dict of the distinct partners with the organisation as key and as content: 1. The partnerships of the organisation 2. The (added up) funding amount, if available. Otherwise None. E.g. {<Organisation 1>: [[<Partnership 1>,], 10000],}
- 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.
- path
- period_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.
- planned_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.
- policy_markers
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.
- 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
- primary_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.
- primary_organisation_id
- project_dates()[source]
Return the project start and end dates, preferably the actuals. If they are not set, use the planned values.
- project_hierarchy_context(context)[source]
Add info used in single period hierarchy projects if present
- project_plan
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- project_plan_summary
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- project_scope
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- project_updates
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.
- projecthierarchy
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.
- projectrole_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.
- property publishing_orgs
Returns the organisations that have the right to publish the project. In other words, that have Organisation.can_create_project set to True.
- publishingstatus
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.
- recipient_countries
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_regions
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.
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.
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.
- property reporting_org
Returns the organisation of the partnership that is the reporting-org, if there is one
- property reporting_partner
In some cases we need the partnership object instead of the organisation to be able to access is_secondary_reporter
- 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 aReverseManyToOneDescriptor
instance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()
defined below.
- run_iati_checks
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- sectors
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.
- set_parent(parent_project: Project, force: bool = False)[source]
Add this node as a child to a parent
There’s NO a check if this is possible. Use the helper if you want checks
- status
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- subtitle
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- sustainability
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- target_group
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- targets_at
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- third_party_projects
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.
- thumbnails
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.
- title
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- 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.
- update_dimension_value(dimension_name, parent_dimension_value)[source]
Update dimension value base on the parent dimension value attribute.
- update_indicator(result, parent_indicator)[source]
Update an indicator based on parent indicator attributes.
- update_period(indicator, parent_period)[source]
Update a period based on the parent period attributes.
- 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.
- uses_single_indicator_period() str | None [source]
Return the settings name of the hierarchy if there is one
- uuid
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- validations
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.
- class akvo.rsr.models.project.TreeNode(*args, **kwds)[source]
Bases:
Generic
[TreeNodeItem_T
]- item: TreeNodeItem_T
- akvo.rsr.models.project.default_validation_set(sender, **kwargs)[source]
When the project is created, add the RSR validation (pk=1) to the project.
- akvo.rsr.models.project.rewind_last_update(sender, **kwargs)[source]
Updates the denormalized project.last_update on related project
When deleting an update we have to set project.last_update again since it’ll change if the deleted update was tha latest or if it was the only update for the project