akvo.rsr.mixins module

class akvo.rsr.mixins.IndicatorUpdateMixin(*args, **kwargs)[source]

Bases: Model

Mixin used to add indicator update unit & percentage values

class Meta[source]

Bases: object

abstract = False
denominator

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

numerator

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

value

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.mixins.TimestampsAdminDisplayMixin(model, admin_site)[source]

Bases: ModelAdmin

Mixin class that displays the create_at and last_modified_at timestamp fields in the admin

get_fieldsets(request, obj=None)[source]

Add and/or remove ‘created_at’ and ‘last_modified_at’ fields from first fieldset Since the modeladmin object is cached, and thus the fieldsets tuple, we need to be careful to both add and remove the fields as needed

property media
class akvo.rsr.mixins.TimestampsMixin(*args, **kwargs)[source]

Bases: Model

Mixin used to add created and modified timestamp fields

class Meta[source]

Bases: object

abstract = False
created_at

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.