akvo.rsr.models.related_project module
- exception akvo.rsr.models.related_project.MultipleParentsDisallowed[source]
Bases:
Exception
Exception raised when trying to create multiple parents for a project.
- message = 'A project can have only one parent.'
- exception akvo.rsr.models.related_project.ParentChangeDisallowed[source]
Bases:
Exception
Exception raised when trying to change parent after importing results.
- message = "Cannot change a project's parent after importing results."
- class akvo.rsr.models.related_project.RelatedProject(id, project, related_project, related_iati_id, relation)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- PROJECT_RELATION_CHILD = '2'
- PROJECT_RELATION_CO_FUNDED = '4'
- PROJECT_RELATION_PARENT = '1'
- PROJECT_RELATION_SIBLING = '3'
- PROJECT_RELATION_THIRD_PARTY = '5'
- get_relation_display(*, field=<akvo.rsr.fields.ValidXMLCharField: relation>)
- 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>
- 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.
- project_id
- property reciprocal_relation
Return the relation between related_project and project.
relation specifies the relationship between project and related_project. This returns the reciprocal relationship.
- related_iati_id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- related_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.
- related_project_id
- relation
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.