dokomoforms package

Submodules

dokomoforms.exc module

The base exception class is DokomoError.

exception dokomoforms.exc.DokomoError[source]

Bases: Exception

The base class for all exceptions used in Dokomo Forms.

exception dokomoforms.exc.InvalidTypeForOperation[source]

Bases: dokomoforms.exc.DokomoError

Invalid type for the selected aggregation function.

For instance, you can’t find the maximum of a text answer.

exception dokomoforms.exc.NoSuchBucketTypeError[source]

Bases: dokomoforms.exc.DokomoError

Invalid type_constraint for construct_bucket.

Raised when dokomoforms.models.survey.construct_bucket is called with an invalid type_constraint.

The valid type_constraints are the keys of dokomoforms.models.survey.BUCKET_TYPES.

exception dokomoforms.exc.NoSuchNodeTypeError[source]

Bases: dokomoforms.exc.DokomoError

Invalid type_constraint for construct_node.

Raised when dokomoforms.models.node.construct_node is called with an invalid type_constraint.

The valid type_constraints are the keys of dokomoforms.models.node.NODE_TYPES.

exception dokomoforms.exc.NoSuchSubmissionTypeError[source]

Bases: dokomoforms.exc.DokomoError

Invalid submission_type for construct_submission.

Raised when dokomoforms.models.submission.construct_submission is called with an invalid submission_type.

The valid types are ‘unathenticated’ and ‘enumerator_only_submission’

exception dokomoforms.exc.NotAResponseTypeError[source]

Bases: dokomoforms.exc.DokomoError

Invalid response_type Answer.response.setter.

Raised when trying to set the response field on an Answer with an invalid response_type.

The valid response_types are ‘answer’, ‘other’, and ‘dont_know’.

exception dokomoforms.exc.NotAnAnswerTypeError[source]

Bases: dokomoforms.exc.DokomoError

Invalid type_constraint for construct_answer.

Raised when dokomoforms.models.node.construct_answer is called with an invalid type_constraint.

The valid type_constraints are the keys of dokomoforms.models.answer.ANSWER_TYPES.

exception dokomoforms.exc.NotJSONifiableError[source]

Bases: dokomoforms.exc.DokomoError

The jsonify function encountered a strange object.

exception dokomoforms.exc.PhotoIdDoesNotExistError[source]

Bases: dokomoforms.exc.DokomoError

The submitted photo ID does not exist in the database.

exception dokomoforms.exc.RequiredQuestionSkipped[source]

Bases: dokomoforms.exc.DokomoError

A submission has no answer for a required question.

exception dokomoforms.exc.SurveyAccessForbidden[source]

Bases: dokomoforms.exc.DokomoError

The logged-in user does not have access to the survey.

exception dokomoforms.exc.UserRequiresEmailError[source]

Bases: dokomoforms.exc.DokomoError

A user must have at least one e-mail address.

dokomoforms.options module

All the application options are defined here.

If you need to inject options at runtime (for testing, etc...):

from dokomoforms.options import parse_options

parse_options(name1=value1, name2=value2, ...)

Module contents

Top level module for Dokomo Forms.

All of the application code for Dokomoforms (outside of the webapp.py script) lives in this module.