akvo.rsr.models.employment module
- class akvo.rsr.models.employment.Employment(id, organisation, user, group, is_approved, receives_indicator_aggregation_emails, country, job_title)[source]
Bases:
Model
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- approve(approved_by)[source]
Approve an Employment. Will also be logged in the Employment admin history.
- Parameters:
approved_by – User that approves the Employment
- country
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- get_country_display(*, field=<akvo.rsr.fields.ValidXMLCharField: country>)
- group
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.
- group_id
- id
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- is_approved
A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
- job_title
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.ManagerFromEmploymentQuerySet 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
- receives_indicator_aggregation_emails
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 aForwardManyToOneDescriptor
instance.
- user_id
- akvo.rsr.models.employment.invalidate_caches(sender: Type[Employment], instance: Employment | None = None, **kwargs)[source]
Ensure related cache keys are removed to prevent access to old data