onadata.libs.mixins package¶
Submodules¶
onadata.libs.mixins.anonymous_user_mixin module¶
onadata.libs.mixins.anonymous_user_public_forms_mixin module¶
onadata.libs.mixins.authenticate_header_mixin module¶
onadata.libs.mixins.cache_control_mixin module¶
onadata.libs.mixins.etags_mixin module¶
Bases:
object
Applies the Etag on GET responses with status code 200, 201, 202
- self.etag_data - if it is set, the etag is calculated from this data,
- otherwise the date_modifed of self.object or self.object_list is used.
onadata.libs.mixins.labels_mixin module¶
-
class
onadata.libs.mixins.labels_mixin.
LabelsMixin
¶ Bases:
object
-
labels
(request, format='json', **kwargs)¶
-
-
class
onadata.libs.mixins.labels_mixin.
TagForm
(data=None, files=None, auto_id=u'id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None)¶ Bases:
django.forms.forms.Form
-
base_fields
= OrderedDict([('tags', <taggit.forms.TagField object at 0x7ffa0bd729d0>)])¶
-
declared_fields
= OrderedDict([('tags', <taggit.forms.TagField object at 0x7ffa0bd729d0>)])¶
-
media
¶
-
-
onadata.libs.mixins.labels_mixin.
process_label_request
(request, label, instance)¶ Process request to labels endpoint.
Parameters: - request – HTTP request object.
- label – label that is being acted on.
- instance – object that label is applied to.
Returns: A response object based on the type of request.
onadata.libs.mixins.last_modified_mixin module¶
onadata.libs.mixins.multi_lookup_mixin module¶
onadata.libs.mixins.object_lookup_mixin module¶
onadata.libs.mixins.openrosa_headers_mixin module¶
onadata.libs.mixins.profiler_mixin module¶
-
class
onadata.libs.mixins.profiler_mixin.
ProfilerMixin
¶ Bases:
object
-
dispatch
(request, *args, **kwargs)¶
-
get_serializer
(instance=None, data=<class rest_framework.fields.empty>, **kwargs)¶
-
-
onadata.libs.mixins.profiler_mixin.
finished
(sender, **kwargs)¶
-
onadata.libs.mixins.profiler_mixin.
started
(sender, **kwargs)¶