backend.globaleaks.handlers.admin.questionnaire

Module Contents

Functions

db_get_questionnaires(session, tid, language) Transaction to retrieve the questionnnaires associated to a tenant
db_get_questionnaire(session, tid, questionnaire_id, language, serialize_templates=True)
db_create_questionnaire(session, tid, questionnaire_dict, language)
create_questionnaire(session, tid, request, language) Updates the specified questionnaire. If the key receivers is specified we remove
db_update_questionnaire(session, tid, questionnaire_id, request, language) Updates the specified questionnaire. If the key receivers is specified we remove
duplicate_questionnaire(session, tid, questionnaire_id, new_name) Transaction for duplicating an existing questionnaire
backend.globaleaks.handlers.admin.questionnaire.db_get_questionnaires(session, tid, language)[source]

Transaction to retrieve the questionnnaires associated to a tenant

Parameters:
  • session – the session on which perform queries.
  • tid – A tenant ID
  • language – The language to be used for the serialization
Returns:

a dictionary representing the serialization of the questionnaires.

backend.globaleaks.handlers.admin.questionnaire.db_get_questionnaire(session, tid, questionnaire_id, language, serialize_templates=True)[source]
backend.globaleaks.handlers.admin.questionnaire.db_create_questionnaire(session, tid, questionnaire_dict, language)[source]
backend.globaleaks.handlers.admin.questionnaire.create_questionnaire(session, tid, request, language)[source]

Updates the specified questionnaire. If the key receivers is specified we remove the current receivers of the Questionnaire and reset set it to the new specified ones.

Parameters:
  • session – An ORM session
  • tid – A tenant ID
  • request – The request data
  • language – The language of the request
Returns:

A serialized descriptor of the questionnaire

backend.globaleaks.handlers.admin.questionnaire.db_update_questionnaire(session, tid, questionnaire_id, request, language)[source]

Updates the specified questionnaire. If the key receivers is specified we remove the current receivers of the Questionnaire and reset set it to the new specified ones.

Parameters:
  • session – An ORM session
  • tid – A tenant ID
  • questionnaire_id – The ID of the model to be updated
  • request – The request data
  • language – The language of the request
Returns:

A serialized descriptor of the questionnaire

backend.globaleaks.handlers.admin.questionnaire.duplicate_questionnaire(session, tid, questionnaire_id, new_name)[source]

Transaction for duplicating an existing questionnaire

Parameters:
  • session – An ORM session
  • tid – A tnenat ID

:param questionnaire_id A questionnaire ID :param new_name: The name to be assigned to the new questionnaire

class backend.globaleaks.handlers.admin.questionnaire.QuestionnairesCollection[source]

Bases: globaleaks.handlers.base.BaseHandler

check_roles = admin[source]
cache_resource = True[source]
invalidate_cache = True[source]
get(self)[source]

Return all the questionnaires.

post(self)[source]

Create a new questionnaire.

class backend.globaleaks.handlers.admin.questionnaire.QuestionnaireInstance[source]

Bases: globaleaks.handlers.base.BaseHandler

check_roles = admin[source]
invalidate_cache = True[source]
put(self, questionnaire_id)[source]

Update the specified questionnaire.

delete(self, questionnaire_id)[source]

Delete the specified questionnaire.

get(self, questionnaire_id)[source]

Export questionnaire JSON

class backend.globaleaks.handlers.admin.questionnaire.QuestionnareDuplication[source]

Bases: globaleaks.handlers.base.BaseHandler

check_roles = admin[source]
invalidate_cache = True[source]
post(self)[source]

Duplicates a questionnaire